Skip to content

Commit

Permalink
added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shivankacker committed Sep 13, 2024
1 parent 6ea255b commit 1c2646f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions care/facility/tests/test_patient_daily_rounds_api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import datetime
from datetime import timedelta

from django.utils import timezone
from rest_framework import status
from rest_framework.test import APITestCase

Expand Down Expand Up @@ -126,3 +128,15 @@ def test_doctors_log_update(self):
data={**self.log_update, "rounds_type": "DOCTORS_LOG"},
)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)

def test_invalid_taken_at(self):
data = {
**self.log_update,
"taken_at": timezone.now() + timedelta(minutes=5),
}
response = self.client.post(
f"/api/v1/consultation/{self.consultation_with_bed.external_id}/daily_rounds/",
data,
)
print(response.json())
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)

0 comments on commit 1c2646f

Please sign in to comment.