fix: Update import paths to use 'apps' prefix for models and services

This commit is contained in:
pacnpal
2025-09-28 10:50:57 -04:00
parent 1b246eeaa4
commit bf04e4d854
6 changed files with 395 additions and 363 deletions

View File

@@ -4,16 +4,24 @@ Test script for the unified map service.
This script tests the map service with real location data.
"""
from core.services.data_structures import GeoBounds, MapFilters, LocationType
from core.services.map_service import unified_map_service
import os
import sys
import django
# Setup Django environment
# Ensure project root is on sys.path so imports like `core.services.*` resolve.
# This inserts the parent directory of the tests folder (project root).
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if PROJECT_ROOT not in sys.path:
sys.path.insert(0, PROJECT_ROOT)
# Setup Django environment before importing app modules that depend on settings.
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "thrillwiki.settings")
django.setup()
# Now import project modules
from apps.core.services.data_structures import GeoBounds, MapFilters, LocationType # noqa: E402
from apps.core.services.map_service import unified_map_service # noqa: E402
def test_basic_map_service():
"""Test basic map service functionality."""
@@ -215,7 +223,7 @@ def test_performance():
print(f" Max time: {max(times):.2f}ms")
# Test cache performance
print(f"\n Testing cache performance:")
print("\n Testing cache performance:")
start = time.time()
response1 = unified_map_service.get_map_data(zoom_level=10, use_cache=True)
time1 = time.time() - start