forked from CGM_Public/pretix_original
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
|
It runs the local frontend server, if node is installed and the setting
|
||||||
is set.
|
is set.
|
||||||
"""
|
"""
|
||||||
import os
|
|
||||||
import atexit
|
import atexit
|
||||||
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from django.conf import settings
|
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
|
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 os
|
||||||
import subprocess
|
import subprocess
|
||||||
import pytest
|
from datetime import date, datetime, timedelta, timezone
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from datetime import date, datetime, timezone, timedelta
|
|
||||||
from urllib.request import urlopen
|
|
||||||
from urllib.error import URLError
|
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 django_scopes import scopes_disabled
|
||||||
|
from playwright.sync_api import ( # noqa: F401
|
||||||
|
Browser, BrowserContext, Page, expect,
|
||||||
|
)
|
||||||
|
|
||||||
from pretix.base.models import (
|
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)
|
# 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
|
return live_server.url
|
||||||
|
|
||||||
|
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
# Test Data Fixtures - Organizers and Events
|
# Test Data Fixtures - Organizers and Events
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
@@ -1035,11 +1039,13 @@ def item_not_yet_available(event):
|
|||||||
@scopes_disabled()
|
@scopes_disabled()
|
||||||
def item_with_picture(event):
|
def item_with_picture(event):
|
||||||
"""Create an item with a product picture."""
|
"""Create an item with a product picture."""
|
||||||
from pretix.base.models import ItemCategory
|
|
||||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
|
||||||
import io
|
import io
|
||||||
|
|
||||||
|
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||||
from PIL import Image as PILImage
|
from PIL import Image as PILImage
|
||||||
|
|
||||||
|
from pretix.base.models import ItemCategory
|
||||||
|
|
||||||
category = ItemCategory.objects.create(
|
category = ItemCategory.objects.create(
|
||||||
event=event,
|
event=event,
|
||||||
name='Gallery Items',
|
name='Gallery Items',
|
||||||
@@ -1113,8 +1119,9 @@ def _register_widget_test_view():
|
|||||||
set_content, which causes CORS issues.
|
set_content, which causes CORS issues.
|
||||||
"""
|
"""
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from django.views import View
|
|
||||||
from django.urls import path
|
from django.urls import path
|
||||||
|
from django.views import View
|
||||||
|
|
||||||
from pretix.multidomain import maindomain_urlconf as urls
|
from pretix.multidomain import maindomain_urlconf as urls
|
||||||
|
|
||||||
class WidgetTestView(View):
|
class WidgetTestView(View):
|
||||||
|
|||||||
Reference in New Issue
Block a user