mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2026-01-02 01:47:04 -05:00
feat: Implement initial schema and add various API, service, and management command enhancements across the application.
This commit is contained in:
@@ -202,9 +202,7 @@ class RideFactory(DjangoModelFactory):
|
||||
manufacturer = factory.SubFactory(ManufacturerCompanyFactory)
|
||||
designer = factory.SubFactory(DesignerCompanyFactory)
|
||||
ride_model = factory.SubFactory(RideModelFactory)
|
||||
park_area = factory.SubFactory(
|
||||
ParkAreaFactory, park=factory.SelfAttribute("..park")
|
||||
)
|
||||
park_area = factory.SubFactory(ParkAreaFactory, park=factory.SelfAttribute("..park"))
|
||||
|
||||
@factory.post_generation
|
||||
def create_location(obj, create, extracted, **kwargs):
|
||||
@@ -297,9 +295,7 @@ class Traits:
|
||||
"""Trait for closed parks."""
|
||||
return {
|
||||
"status": "CLOSED_PERM",
|
||||
"closing_date": factory.Faker(
|
||||
"date_between", start_date="-10y", end_date="today"
|
||||
),
|
||||
"closing_date": factory.Faker("date_between", start_date="-10y", end_date="today"),
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
@@ -310,11 +306,7 @@ class Traits:
|
||||
@staticmethod
|
||||
def recent_submission():
|
||||
"""Trait for recent submissions."""
|
||||
return {
|
||||
"submitted_at": factory.Faker(
|
||||
"date_time_between", start_date="-7d", end_date="now"
|
||||
)
|
||||
}
|
||||
return {"submitted_at": factory.Faker("date_time_between", start_date="-7d", end_date="now")}
|
||||
|
||||
|
||||
# Specialized factories for testing scenarios
|
||||
@@ -378,11 +370,13 @@ class CloudflareImageFactory(DjangoModelFactory):
|
||||
@factory.lazy_attribute
|
||||
def expires_at(self):
|
||||
from django.utils import timezone
|
||||
|
||||
return timezone.now() + timezone.timedelta(days=365)
|
||||
|
||||
@factory.lazy_attribute
|
||||
def uploaded_at(self):
|
||||
from django.utils import timezone
|
||||
|
||||
return timezone.now()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user