diff options
author | 2019-04-05 12:11:31 +0100 | |
---|---|---|
committer | 2019-04-05 12:11:31 +0100 | |
commit | ebda74029355ce3236ca9266acde40fd40329df7 (patch) | |
tree | aba491f902c874328c88b8e7ccb9772b5414c17f /pysite/apps/api/tests/test_healthcheck.py | |
parent | Set `harakiri = 30`. (diff) |
[#176] Redo project layout
Diffstat (limited to 'pysite/apps/api/tests/test_healthcheck.py')
-rw-r--r-- | pysite/apps/api/tests/test_healthcheck.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pysite/apps/api/tests/test_healthcheck.py b/pysite/apps/api/tests/test_healthcheck.py new file mode 100644 index 00000000..b0fd71bf --- /dev/null +++ b/pysite/apps/api/tests/test_healthcheck.py @@ -0,0 +1,16 @@ +from django_hosts.resolvers import reverse + +from .base import APISubdomainTestCase + + +class UnauthedHealthcheckAPITests(APISubdomainTestCase): + def setUp(self): + super().setUp() + self.client.force_authenticate(user=None) + + def test_can_access_healthcheck_view(self): + url = reverse('healthcheck', host='api') + response = self.client.get(url) + + self.assertEqual(response.status_code, 200) + self.assertEqual(response.json(), {'status': 'ok'}) |