Skip to content
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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

DraKen0009
Copy link
Contributor

@DraKen0009 DraKen0009 commented Apr 20, 2024

Proposed Changes

  • Created Testcases for Bed Enpoint

Associated Issue

fixes #2103

Merge Checklist

  • Tests added/fixed
  • Linting Complete

Only PR's with test cases included and passing lint and test pipelines will be reviewed

@coronasafe/care-backend-maintainers @coronasafe/care-backend-admins

@DraKen0009 DraKen0009 requested a review from a team as a code owner April 20, 2024 17:01
Copy link
Member

@khavinshankar khavinshankar left a 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)
Copy link
Member

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)
Copy link
Member

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

Copy link
Member

@rithviknishad rithviknishad left a 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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
response = self.client.get("/api/v1/bed/?bed_type=ISOLATION")
response = self.client.get("/api/v1/bed/", {"bed_type": "ISOLATION"})

Comment on lines +53 to +55
response = self.client.get(
f"/api/v1/bed/?facility={self.facility2.external_id}"
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 },
)

Comment on lines +59 to +61
response = self.client.get(
f"/api/v1/bed/?location={self.asset_location2.external_id}"
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 },
)

@gigincg
Copy link
Member

gigincg commented May 14, 2024

@DraKen0009 Can you make the changes?

@DraKen0009
Copy link
Contributor Author

Yep. I'll update the PR by tonight or tomorrow afternoon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test cases for Beds module
4 participants