aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/apps/api/tests/test_healthcheck.py
diff options
context:
space:
mode:
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'})