-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunch.py
More file actions
42 lines (30 loc) · 1.16 KB
/
launch.py
File metadata and controls
42 lines (30 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import os
from datetime import timedelta
from django.core.wsgi import get_wsgi_application
from django.utils import timezone
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
application = get_wsgi_application()
from integrations.aws.s3 import Client # noqa: E402
from photo.tests.factories import ContestFactory, ContestSubmissionFactory # noqa: E402
from utils.enums import ContestInternalStates # noqa: E402
client = Client()
client.create_bucket()
contests = ContestFactory.create_batch(5)
for contest in contests:
ContestSubmissionFactory.create_batch(5, contest=contest)
time = timezone.now()
voting = ContestFactory(
upload_phase_start=time - timedelta(days=3),
)
ContestSubmissionFactory.create_batch(10, contest=voting)
voting.upload_phase_end = time - timedelta(days=2)
voting.voting_phase_end = time + timedelta(days=1)
voting.save()
closed = ContestFactory(
upload_phase_start=time - timedelta(days=3),
)
ContestSubmissionFactory.create_batch(10, contest=closed)
closed.upload_phase_end = time - timedelta(days=2)
closed.voting_phase_end = time - timedelta(days=1)
closed.internal_status = ContestInternalStates.CLOSED
closed.save()