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:
@@ -19,12 +19,8 @@ class ParkFilterTests(TestCase):
|
||||
def setUpTestData(cls):
|
||||
"""Set up test data for all filter tests"""
|
||||
# Create operators
|
||||
cls.operator1 = Company.objects.create(
|
||||
name="Thrilling Adventures Inc", slug="thrilling-adventures"
|
||||
)
|
||||
cls.operator2 = Company.objects.create(
|
||||
name="Family Fun Corp", slug="family-fun"
|
||||
)
|
||||
cls.operator1 = Company.objects.create(name="Thrilling Adventures Inc", slug="thrilling-adventures")
|
||||
cls.operator2 = Company.objects.create(name="Family Fun Corp", slug="family-fun")
|
||||
|
||||
# Create parks with various attributes for testing all filters
|
||||
cls.park1 = Park.objects.create(
|
||||
|
||||
@@ -89,9 +89,7 @@ class ParkModelTests(TestCase):
|
||||
# Check pghistory records
|
||||
event_model = getattr(Park, "event_model", None)
|
||||
if event_model:
|
||||
historical_records = event_model.objects.filter(
|
||||
pgh_obj_id=park.id
|
||||
).order_by("-pgh_created_at")
|
||||
historical_records = event_model.objects.filter(pgh_obj_id=park.id).order_by("-pgh_created_at")
|
||||
print("\nPG History records:")
|
||||
for record in historical_records:
|
||||
print(f"- Event ID: {record.pgh_id}")
|
||||
@@ -104,17 +102,13 @@ class ParkModelTests(TestCase):
|
||||
# Try to find by old slug
|
||||
found_park, is_historical = Park.get_by_slug(original_slug)
|
||||
self.assertEqual(found_park.id, park.id)
|
||||
print(
|
||||
f"Found park by old slug: {found_park.slug}, is_historical: {is_historical}"
|
||||
)
|
||||
print(f"Found park by old slug: {found_park.slug}, is_historical: {is_historical}")
|
||||
self.assertTrue(is_historical)
|
||||
|
||||
# Try current slug
|
||||
found_park, is_historical = Park.get_by_slug(new_slug)
|
||||
self.assertEqual(found_park.id, park.id)
|
||||
print(
|
||||
f"Found park by new slug: {found_park.slug}, is_historical: {is_historical}"
|
||||
)
|
||||
print(f"Found park by new slug: {found_park.slug}, is_historical: {is_historical}")
|
||||
self.assertFalse(is_historical)
|
||||
|
||||
def test_status_color_mapping(self):
|
||||
@@ -141,15 +135,9 @@ class ParkModelTests(TestCase):
|
||||
class ParkAreaModelTests(TestCase):
|
||||
def setUp(self):
|
||||
"""Set up test data"""
|
||||
self.operator = Company.objects.create(
|
||||
name="Test Company 2", slug="test-company-2"
|
||||
)
|
||||
self.park = Park.objects.create(
|
||||
name="Test Park", status="OPERATING", operator=self.operator
|
||||
)
|
||||
self.area = ParkArea.objects.create(
|
||||
park=self.park, name="Test Area", description="A test area"
|
||||
)
|
||||
self.operator = Company.objects.create(name="Test Company 2", slug="test-company-2")
|
||||
self.park = Park.objects.create(name="Test Park", status="OPERATING", operator=self.operator)
|
||||
self.area = ParkArea.objects.create(park=self.park, name="Test Area", description="A test area")
|
||||
|
||||
def test_area_creation(self):
|
||||
"""Test basic area creation and fields"""
|
||||
|
||||
Reference in New Issue
Block a user