mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 10:51:09 -05:00
fix: Update import paths to use 'apps' prefix for models and services
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user