aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/apps/api/tests/test_healthcheck.py
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2019-04-05 12:11:31 +0100
committerGravatar Gareth Coles <[email protected]>2019-04-05 12:11:31 +0100
commitebda74029355ce3236ca9266acde40fd40329df7 (patch)
treeaba491f902c874328c88b8e7ccb9772b5414c17f /pysite/apps/api/tests/test_healthcheck.py
parentSet `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.py16
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'})