-
-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathconftest.py
More file actions
72 lines (63 loc) · 1.92 KB
/
conftest.py
File metadata and controls
72 lines (63 loc) · 1.92 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import pytest
from attendee.models import (
PRETIX_ANONYMOUS_DONATION_QUESTION_IDENTIFIER,
PRETIX_NOT_ANONYMOUS_ANSWER_IDENTIFIER,
)
from volunteer.models import Language
@pytest.fixture
def portal_user(db, django_user_model):
username = "testuser"
password = "testpassword"
email = "test@example.com"
first_name = "fname"
last_name = "lname"
return django_user_model.objects.create_user(
username=username,
password=password,
email=email,
first_name=first_name,
last_name=last_name,
)
@pytest.fixture
def admin_user(db, django_user_model):
username = "adminuser"
password = "adminpassword"
email = "admin@example.com"
first_name = "admin_fname"
last_name = "admin_lname"
return django_user_model.objects.create_superuser(
username=username,
password=password,
email=email,
first_name=first_name,
last_name=last_name,
)
@pytest.fixture
def language(db):
return Language.objects.create(code="en", name="English")
@pytest.fixture
def pretix_order_data():
return {
"code": "ORDER123",
"event": "2025",
"status": "p",
"testmode": False,
"email": "attendee@example.com",
"datetime": "2025-11-13T17:12:03.989259+01:00",
"total": "30.00",
"positions": [
{
"attendee_name": "Example Attendee",
"answers": [
{"question_identifier": "QUESTION123", "option_identifiers": []},
{
"option_identifiers": [PRETIX_NOT_ANONYMOUS_ANSWER_IDENTIFIER],
"question_identifier": PRETIX_ANONYMOUS_DONATION_QUESTION_IDENTIFIER,
},
],
}
],
"last_modified": "2025-11-13T17:12:07.002602+01:00",
"url": "https://someurl/",
"cancellation_date": None,
}