Skip to content

Commit

Permalink
fix(test-data): signup_closing is before script has run
Browse files Browse the repository at this point in the history
The ActivityFactory made the signup_closing field be a date +/-100 days from when the script was run. This made some acitivities not show up in the activities overview of the website, since the signup had already closed. This is now fixed by setting signup_closed to a date 1-10 days in the future.
  • Loading branch information
Dansk-Torskerognsforening committed Aug 3, 2024
1 parent e821866 commit fd15dcd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions members/management/commands/create_dummy_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
from django.utils import timezone
from collections import namedtuple

from members.tests.factories.factory_helpers import TIMEZONE

# We're creating a union for each region.
# A named tuple with a name for the Union, and a name for the region to use in its address.
Union_to_create = namedtuple("Union_to_create", "union_name region_name")
Expand Down Expand Up @@ -92,6 +94,9 @@ def _create_activity(department):
max_participants=Faker("random_int", min=10, max=100),
price_in_dkk=Faker("random_int", min=500, max=1000),
address=AddressFactory(region=department.address.region),
signup_closing=Faker(
"date_time_between", tzinfo=TIMEZONE, start_date="+1d", end_date="+10d"
),
)
# Creates 2 children and assigns them to the activity
ActivityParticipantFactory(person=_create_child(), activity=activity)
Expand Down

0 comments on commit fd15dcd

Please sign in to comment.