mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 14:31:08 -05:00
major changes, including tailwind v4
This commit is contained in:
@@ -2,30 +2,29 @@ from django.test import TestCase, Client
|
||||
from django.urls import reverse
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.contrib.gis.geos import Point
|
||||
from django.http import HttpResponse
|
||||
from typing import cast, Optional, Tuple
|
||||
from .models import Park, ParkArea
|
||||
from operators.models import Operator
|
||||
from location.models import Location
|
||||
from parks.models.companies import Operator
|
||||
from parks.models.location import ParkLocation
|
||||
|
||||
User = get_user_model()
|
||||
|
||||
def create_test_location(park: Park) -> Location:
|
||||
def create_test_location(park: Park) -> ParkLocation:
|
||||
"""Helper function to create a test location"""
|
||||
return Location.objects.create(
|
||||
content_type=ContentType.objects.get_for_model(Park),
|
||||
object_id=park.id,
|
||||
name='Test Park Location',
|
||||
location_type='park',
|
||||
park_location = ParkLocation.objects.create(
|
||||
park=park,
|
||||
street_address='123 Test St',
|
||||
city='Test City',
|
||||
state='TS',
|
||||
country='Test Country',
|
||||
postal_code='12345',
|
||||
point=Point(-118.2437, 34.0522)
|
||||
postal_code='12345'
|
||||
)
|
||||
# Set coordinates using the helper method
|
||||
park_location.set_coordinates(34.0522, -118.2437) # latitude, longitude
|
||||
park_location.save()
|
||||
return park_location
|
||||
|
||||
class ParkModelTests(TestCase):
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user