aboutsummaryrefslogtreecommitdiffstats
path: root/api/tests/test_healthcheck.py
blob: b0fd71bf8f82ea6c1eb92b83c13a39fdd0db6687 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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'})