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.

23 lines
870 B

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