mirror of
https://github.com/pretix/pretix.git
synced 2026-05-20 17:44:02 +00:00
fix python linter errors
This commit is contained in:
@@ -6,13 +6,15 @@
|
||||
It runs the local frontend server, if node is installed and the setting
|
||||
is set.
|
||||
"""
|
||||
import os
|
||||
import atexit
|
||||
import os
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.staticfiles.management.commands.runserver import Command as Parent
|
||||
from django.contrib.staticfiles.management.commands.runserver import (
|
||||
Command as Parent,
|
||||
)
|
||||
from django.utils.autoreload import DJANGO_AUTORELOAD_ENV
|
||||
|
||||
|
||||
|
||||
@@ -9,16 +9,19 @@ using Playwright. It integrates Playwright with Django's test infrastructure.
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import pytest
|
||||
from datetime import date, datetime, timedelta, timezone
|
||||
from decimal import Decimal
|
||||
from datetime import date, datetime, timezone, timedelta
|
||||
from urllib.request import urlopen
|
||||
from urllib.error import URLError
|
||||
from playwright.sync_api import Browser, BrowserContext, Page, expect
|
||||
from urllib.request import urlopen
|
||||
|
||||
import pytest
|
||||
from django_scopes import scopes_disabled
|
||||
from playwright.sync_api import ( # noqa: F401
|
||||
Browser, BrowserContext, Page, expect,
|
||||
)
|
||||
|
||||
from pretix.base.models import (
|
||||
Organizer, Event, Item, Quota, ItemVariation, SubEvent, Voucher
|
||||
Event, Item, ItemVariation, Organizer, Quota, SubEvent, Voucher,
|
||||
)
|
||||
|
||||
# Allow Django ORM operations in async context (required for Playwright integration)
|
||||
@@ -137,6 +140,7 @@ def live_server_url(live_server, settings):
|
||||
|
||||
return live_server.url
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# Test Data Fixtures - Organizers and Events
|
||||
# ============================================================================
|
||||
@@ -1035,11 +1039,13 @@ def item_not_yet_available(event):
|
||||
@scopes_disabled()
|
||||
def item_with_picture(event):
|
||||
"""Create an item with a product picture."""
|
||||
from pretix.base.models import ItemCategory
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
import io
|
||||
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
from PIL import Image as PILImage
|
||||
|
||||
from pretix.base.models import ItemCategory
|
||||
|
||||
category = ItemCategory.objects.create(
|
||||
event=event,
|
||||
name='Gallery Items',
|
||||
@@ -1113,8 +1119,9 @@ def _register_widget_test_view():
|
||||
set_content, which causes CORS issues.
|
||||
"""
|
||||
from django.http import HttpResponse
|
||||
from django.views import View
|
||||
from django.urls import path
|
||||
from django.views import View
|
||||
|
||||
from pretix.multidomain import maindomain_urlconf as urls
|
||||
|
||||
class WidgetTestView(View):
|
||||
|
||||
Reference in New Issue
Block a user