mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 13:51:09 -05:00
- Add complete backend/ directory with full Django application - Add frontend/ directory with Vite + TypeScript setup ready for Next.js - Add comprehensive shared/ directory with: - Complete documentation and memory-bank archives - Media files and avatars (letters, park/ride images) - Deployment scripts and automation tools - Shared types and utilities - Add architecture/ directory with migration guides - Configure pnpm workspace for monorepo development - Update .gitignore to exclude .django_tailwind_cli/ build artifacts - Preserve all historical documentation in shared/docs/memory-bank/ - Set up proper structure for full-stack development with shared resources
2.3 KiB
2.3 KiB
Parks Tests Migration Fixes - Owner → Operator
Task Overview
Update parks tests to fix field mismatches from the Company.owner → Operator migration.
Issues Identified
1. test_models.py
- Line 28:
owner=self.operatorshould beoperator=self.operator - Line 50: Correctly uses
self.park.operatorbut creation is wrong
2. test_filters.py
- Line 58:
owner=cls.operator2should beoperator=cls.operator2 - Line 206: Test method name
test_company_filteringreferences old concept - Lines 206-222: Filter tests use
has_ownerwhich should behas_operator
3. test_search.py
- ✅ No issues - creates parks without operators
Required Changes
Field Name Updates
- Change all
owner=tooperator=in Park.objects.create() - Update test assertions from
has_ownertohas_operator - Update filter parameter from
operatorto match new field structure
Test Method Updates
- Rename
test_company_filteringtotest_operator_filtering - Update comments and docstrings to reflect new terminology
Entity Relationship Rules Applied
- Parks MUST have an Operator (required relationship)
- Parks MAY have a PropertyOwner (optional, usually same as Operator)
- Parks CANNOT directly reference Company entities
Files Updated
✅ parks/tests/test_models.py
- Fixed Line 28: Changed
owner=self.operatortooperator=self.operator
✅ parks/tests/test_filters.py
- Fixed Line 58: Changed
owner=cls.operator2tooperator=cls.operator2 - Fixed Line 193: Renamed
test_company_filteringtotest_operator_filtering - Fixed Lines 196-222: Updated filter tests to use
has_operatorinstead ofhas_owner - Fixed Lines 196, 201: Changed
.idto.pkfor proper Django model access
✅ parks/filters.py
- Fixed Line 137: Changed
has_ownertohas_operatorin filter logic
Test Results
- ✅ All owner → operator migration issues resolved
- ✅ Filter tests now pass
- ⚠️ One unrelated test failure in ParkArea historical slug lookup (not migration-related)
Migration Status: COMPLETED
All parks tests have been successfully updated to work with the new operator field and Operator model structure. The entity relationship rules are now properly enforced in the test suite.