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
752 B

  1. from django.test.utils import override_settings
  2. from hc.test import BaseTestCase
  3. @override_settings(PD_VENDOR_KEY="foo")
  4. class AddPdcHelpTestCase(BaseTestCase):
  5. url = "/integrations/add_pdc/"
  6. def test_instructions_work_when_not_logged_in(self):
  7. r = self.client.get(self.url)
  8. self.assertContains(r, "Before adding PagerDuty integration, please log")
  9. def test_instructions_work(self):
  10. self.client.login(username="[email protected]", password="password")
  11. r = self.client.get(self.url)
  12. self.assertContains(r, "If your team uses")
  13. @override_settings(PD_VENDOR_KEY=None)
  14. def test_it_requires_vendor_key(self):
  15. r = self.client.get(self.url)
  16. self.assertEqual(r.status_code, 404)