aboutsummaryrefslogtreecommitdiffstats
path: root/api/tests
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2018-08-16 20:54:01 +0200
committerGravatar Johannes Christ <[email protected]>2018-08-16 20:54:01 +0200
commit9766d41be89a6889b3c99af890f362e18f57d391 (patch)
tree9aa20328d1f374a49e8363e1efa3fc5cd2634900 /api/tests
parentSmall documentation fixes. (diff)
Add a `HealthcheckView`.
Diffstat (limited to 'api/tests')
-rw-r--r--api/tests/test_healthcheck.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/api/tests/test_healthcheck.py b/api/tests/test_healthcheck.py
new file mode 100644
index 00000000..b0fd71bf
--- /dev/null
+++ b/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'})