New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added tests for beds endpoints #2104
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just some minor improvements
|
||
response = self.client.get("/api/v1/bed/?bed_type=ISOLATION") | ||
self.assertEqual(response.status_code, status.HTTP_200_OK) | ||
self.assertEqual(response.data["results"][0]["name"], self.bed2.name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's also check the count here
f"/api/v1/bed/?facility={self.facility2.external_id}" | ||
) | ||
self.assertEqual(response.status_code, status.HTTP_200_OK) | ||
self.assertEqual(response.data["results"][0]["name"], self.bed3.name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's also check the count here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just some minor nitpicks to follow consistent patterns
self.assertEqual(response.status_code, status.HTTP_200_OK) | ||
self.assertEqual(response.data["count"], 3) | ||
|
||
response = self.client.get("/api/v1/bed/?bed_type=ISOLATION") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
response = self.client.get("/api/v1/bed/?bed_type=ISOLATION") | |
response = self.client.get("/api/v1/bed/", {"bed_type": "ISOLATION"}) |
response = self.client.get( | ||
f"/api/v1/bed/?facility={self.facility2.external_id}" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
response = self.client.get( | |
f"/api/v1/bed/?facility={self.facility2.external_id}" | |
) | |
response = self.client.get( | |
f"/api/v1/bed/", | |
{ "facility": self.facility2.external_id }, | |
) |
response = self.client.get( | ||
f"/api/v1/bed/?location={self.asset_location2.external_id}" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
response = self.client.get( | |
f"/api/v1/bed/?location={self.asset_location2.external_id}" | |
) | |
response = self.client.get( | |
"/api/v1/bed/", | |
{ "location": self.asset_location2.external_id }, | |
) |
@DraKen0009 Can you make the changes? |
Yep. I'll update the PR by tonight or tomorrow afternoon. |
Proposed Changes
Associated Issue
fixes #2103
Merge Checklist
Only PR's with test cases included and passing lint and test pipelines will be reviewed
@coronasafe/care-backend-maintainers @coronasafe/care-backend-admins