Skip to content

Commit 6fa2d4c

Browse files
committed
make format
1 parent 7cfdb70 commit 6fa2d4c

File tree

3 files changed

+34
-10
lines changed

3 files changed

+34
-10
lines changed

intbot/core/integrations/pretix.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def download_latest_orders(event: str) -> PretixData:
7777

7878
return pretix_data
7979

80+
8081
def download_latest_products(event: str) -> PretixData:
8182
data = fetch_pretix_data(event, PretixData.PretixResources.products)
8283

@@ -87,6 +88,7 @@ def download_latest_products(event: str) -> PretixData:
8788

8889
return pretix_data
8990

91+
9092
def download_latest_vouchers(event: str) -> PretixData:
9193
data = fetch_pretix_data(event, PretixData.PretixResources.vouchers)
9294

intbot/core/migrations/0006_add_pretix_data_model.py

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,39 @@
55

66

77
class Migration(migrations.Migration):
8-
98
dependencies = [
10-
('core', '0005_add_pretalx_data_model'),
9+
("core", "0005_add_pretalx_data_model"),
1110
]
1211

1312
operations = [
1413
migrations.CreateModel(
15-
name='PretixData',
14+
name="PretixData",
1615
fields=[
17-
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
18-
('uuid', models.UUIDField(default=uuid.uuid4)),
19-
('resource', models.CharField(choices=[('orders', 'Orders'), ('products', 'Products'), ('vouchers', 'Vouchers')], max_length=255)),
20-
('content', models.JSONField()),
21-
('created_at', models.DateTimeField(auto_now_add=True)),
22-
('modified_at', models.DateTimeField(auto_now=True)),
23-
('processed_at', models.DateTimeField(blank=True, null=True)),
16+
(
17+
"id",
18+
models.BigAutoField(
19+
auto_created=True,
20+
primary_key=True,
21+
serialize=False,
22+
verbose_name="ID",
23+
),
24+
),
25+
("uuid", models.UUIDField(default=uuid.uuid4)),
26+
(
27+
"resource",
28+
models.CharField(
29+
choices=[
30+
("orders", "Orders"),
31+
("products", "Products"),
32+
("vouchers", "Vouchers"),
33+
],
34+
max_length=255,
35+
),
36+
),
37+
("content", models.JSONField()),
38+
("created_at", models.DateTimeField(auto_now_add=True)),
39+
("modified_at", models.DateTimeField(auto_now=True)),
40+
("processed_at", models.DateTimeField(blank=True, null=True)),
2441
],
2542
),
2643
]

intbot/tests/test_integrations/test_pretix.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def vouchers_pages_generator(url):
6262
},
6363
)
6464

65+
6566
def products_pages_generator(url):
6667
"""
6768
Generator to simulate pagination.
@@ -108,6 +109,7 @@ def test_fetch_orders_from_pretix():
108109
{"foo": "bar"},
109110
]
110111

112+
111113
@respx.mock
112114
def test_fetch_vouchers_from_pretix():
113115
url = "https://tickets.europython.eu/api/v1/organizers/europython/events/ep2025/vouchers/"
@@ -125,6 +127,7 @@ def test_fetch_vouchers_from_pretix():
125127
{"foo": "bar"},
126128
]
127129

130+
128131
@respx.mock
129132
def test_fetch_products_from_pretix():
130133
url = "https://tickets.europython.eu/api/v1/organizers/europython/events/ep2025/items/"
@@ -160,6 +163,7 @@ def test_download_latest_orders():
160163
{"foo": "bar"},
161164
]
162165

166+
163167
@respx.mock
164168
@pytest.mark.django_db
165169
def test_download_latest_products():
@@ -177,6 +181,7 @@ def test_download_latest_products():
177181
{"foo": "bar"},
178182
]
179183

184+
180185
@respx.mock
181186
@pytest.mark.django_db
182187
def test_download_latest_vouchers():

0 commit comments

Comments
 (0)