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.

21 lines
819 B

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