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.

18 lines
580 B

  1. from django.test.utils import override_settings
  2. from hc.test import BaseTestCase
  3. @override_settings(
  4. PUSHOVER_API_TOKEN="token", PUSHOVER_SUBSCRIPTION_URL="http://example.org"
  5. )
  6. class AddPushoverHelpTestCase(BaseTestCase):
  7. url = "/integrations/add_pushover/"
  8. @override_settings(PUSHOVER_API_TOKEN=None)
  9. def test_it_requires_api_token(self):
  10. r = self.client.get(self.url)
  11. self.assertEqual(r.status_code, 404)
  12. def test_instructions_work_without_login(self):
  13. r = self.client.get(self.url)
  14. self.assertContains(r, "Setup Guide")