You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
917 B

  1. from hc.api.models import Channel
  2. from hc.test import BaseTestCase
  3. class AddMsTeamsTestCase(BaseTestCase):
  4. def setUp(self):
  5. super(AddMsTeamsTestCase, self).setUp()
  6. self.url = "/projects/%s/add_msteams/" % self.project.code
  7. def test_instructions_work(self):
  8. self.client.login(username="[email protected]", password="password")
  9. r = self.client.get(self.url)
  10. self.assertContains(r, "Integration Settings", status_code=200)
  11. def test_it_works(self):
  12. form = {"value": "https://example.com/foo"}
  13. self.client.login(username="[email protected]", password="password")
  14. r = self.client.post(self.url, form)
  15. self.assertRedirects(r, self.channels_url)
  16. c = Channel.objects.get()
  17. self.assertEqual(c.kind, "msteams")
  18. self.assertEqual(c.value, "https://example.com/foo")
  19. self.assertEqual(c.project, self.project)