mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-29 10:47:00 -05:00
Add operators and property owners functionality
- Implemented OperatorListView and OperatorDetailView for managing operators. - Created corresponding templates for operator listing and detail views. - Added PropertyOwnerListView and PropertyOwnerDetailView for managing property owners. - Developed templates for property owner listing and detail views. - Established relationships between parks and operators, and parks and property owners in the models. - Created migrations to reflect the new relationships and fields in the database. - Added admin interfaces for PropertyOwner management. - Implemented tests for operators and property owners.
This commit is contained in:
@@ -9,13 +9,13 @@ from django.utils import timezone
|
||||
from datetime import date
|
||||
|
||||
from parks.models import Park, ParkArea
|
||||
from companies.models import Company
|
||||
from operators.models import Operator
|
||||
from location.models import Location
|
||||
|
||||
class ParkModelTests(TestCase):
|
||||
def setUp(self):
|
||||
"""Set up test data"""
|
||||
self.company = Company.objects.create(
|
||||
self.operator = Operator.objects.create(
|
||||
name="Test Company",
|
||||
slug="test-company"
|
||||
)
|
||||
@@ -25,7 +25,7 @@ class ParkModelTests(TestCase):
|
||||
name="Test Park",
|
||||
description="A test park",
|
||||
status="OPERATING",
|
||||
owner=self.company
|
||||
owner=self.operator
|
||||
)
|
||||
|
||||
# Create location for the park
|
||||
@@ -47,7 +47,7 @@ class ParkModelTests(TestCase):
|
||||
self.assertEqual(self.park.name, "Test Park")
|
||||
self.assertEqual(self.park.slug, "test-park")
|
||||
self.assertEqual(self.park.status, "OPERATING")
|
||||
self.assertEqual(self.park.owner, self.company)
|
||||
self.assertEqual(self.park.operator, self.operator)
|
||||
|
||||
def test_slug_generation(self):
|
||||
"""Test automatic slug generation"""
|
||||
|
||||
Reference in New Issue
Block a user