feat: Implement MFA authentication, add ride statistics model, and update various services, APIs, and tests across the application.

This commit is contained in:
pacnpal
2025-12-28 17:32:53 -05:00
parent aa56c46c27
commit c95f99ca10
452 changed files with 7948 additions and 6073 deletions

View File

@@ -3,11 +3,12 @@ Tests for park filtering functionality including search, status filtering,
date ranges, and numeric validations.
"""
from django.test import TestCase
from datetime import date
from apps.parks.models import Park, ParkLocation, Company
from django.test import TestCase
from apps.parks.filters import ParkFilter
from apps.parks.models import Company, Park, ParkLocation
# NOTE: These tests need to be updated to work with the new ParkLocation model
# instead of the generic Location model

View File

@@ -3,10 +3,10 @@ Tests for park models functionality including CRUD operations,
slug handling, status management, and location integration.
"""
from django.test import TestCase
from django.db import IntegrityError
from django.test import TestCase
from apps.parks.models import Park, ParkArea, ParkLocation, Company
from apps.parks.models import Company, Park, ParkArea, ParkLocation
# NOTE: These tests need to be updated to work with the new ParkLocation model
# instead of the generic Location model
@@ -55,9 +55,9 @@ class ParkModelTests(TestCase):
def test_historical_slug_lookup(self):
"""Test finding park by historical slug"""
from django.db import transaction
from django.contrib.contenttypes.models import ContentType
from core.history import HistoricalSlug
from django.contrib.contenttypes.models import ContentType
from django.db import transaction
with transaction.atomic():
# Create initial park with a specific name/slug
@@ -162,12 +162,11 @@ class ParkAreaModelTests(TestCase):
from django.db import transaction
# Try to create area with same slug in same park
with transaction.atomic():
with self.assertRaises(IntegrityError):
ParkArea.objects.create(
park=self.park,
name="Test Area", # Will generate same slug
)
with transaction.atomic(), self.assertRaises(IntegrityError):
ParkArea.objects.create(
park=self.park,
name="Test Area", # Will generate same slug
)
# Should be able to use same name in different park
other_park = Park.objects.create(name="Other Park", operator=self.operator)

View File

@@ -1,9 +1,9 @@
import pytest
from django.urls import reverse
from django.test import Client
from django.urls import reverse
from apps.parks.models import Park
from apps.parks.forms import ParkAutocomplete, ParkSearchForm
from apps.parks.models import Park
@pytest.mark.django_db