Browse Source

Remove Health API

pull/1657/head
Hironsan 3 years ago
parent
commit
8676e1b5f6
3 changed files with 1 additions and 28 deletions
  1. 12
      backend/api/tests/api/test_other.py
  2. 7
      backend/api/urls.py
  3. 10
      backend/api/views/health.py

12
backend/api/tests/api/test_other.py

@ -1,12 +0,0 @@
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
class TestHealthEndpoint(APITestCase):
@classmethod
def setUpTestData(cls):
cls.url = reverse(viewname='health')
def test_returns_green_status_on_health_endpoint(self):
response = self.client.get(self.url, format='json')
self.assertEqual(response.data['status'], 'green')

7
backend/api/urls.py

@ -1,6 +1,6 @@
from django.urls import include, path
from .views import health, project, tag, task
from .views import project, tag, task
urlpatterns_project = [
path(
@ -16,11 +16,6 @@ urlpatterns_project = [
]
urlpatterns = [
path(
route='health',
view=health.Health.as_view(),
name='health'
),
path(
route='projects',
view=project.ProjectList.as_view(),

10
backend/api/views/health.py

@ -1,10 +0,0 @@
from rest_framework.permissions import IsAuthenticatedOrReadOnly
from rest_framework.response import Response
from rest_framework.views import APIView
class Health(APIView):
permission_classes = (IsAuthenticatedOrReadOnly,)
def get(self, request, *args, **kwargs):
return Response({'status': 'green'})
Loading…
Cancel
Save