mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2026-01-02 01:47:04 -05:00
feat: Implement initial schema and add various API, service, and management command enhancements across the application.
This commit is contained in:
@@ -75,9 +75,7 @@ class TestParkListApi(APITestCase):
|
||||
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||
|
||||
# Should return only operating parks (2 out of 3)
|
||||
operating_parks = [
|
||||
p for p in response.data["data"] if p["status"] == "OPERATING"
|
||||
]
|
||||
operating_parks = [p for p in response.data["data"] if p["status"] == "OPERATING"]
|
||||
self.assertEqual(len(operating_parks), 2)
|
||||
|
||||
def test__park_list_api__with_search_query__returns_matching_results(self):
|
||||
@@ -315,9 +313,7 @@ class TestParkApiErrorHandling(APITestCase):
|
||||
"""Test that malformed JSON returns proper error."""
|
||||
url = reverse("parks_api:park-list")
|
||||
|
||||
response = self.client.post(
|
||||
url, data='{"invalid": json}', content_type="application/json"
|
||||
)
|
||||
response = self.client.post(url, data='{"invalid": json}', content_type="application/json")
|
||||
|
||||
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
|
||||
self.assertEqual(response.data["status"], "error")
|
||||
@@ -358,9 +354,7 @@ class TestParkApiIntegration(APITestCase):
|
||||
retrieve_response = self.client.get(detail_url)
|
||||
|
||||
self.assertEqual(retrieve_response.status_code, status.HTTP_200_OK)
|
||||
self.assertEqual(
|
||||
retrieve_response.data["data"]["name"], "Integration Test Park"
|
||||
)
|
||||
self.assertEqual(retrieve_response.data["data"]["name"], "Integration Test Park")
|
||||
|
||||
# 3. Update park
|
||||
update_data = {"description": "Updated integration test description"}
|
||||
|
||||
Reference in New Issue
Block a user