repair tests

This commit is contained in:
Lukas Bockstaller
2026-08-21 16:40:03 +02:00
parent 83cb12281f
commit 622858314a
5 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ Core
item_copy_data, register_sales_channel_types, register_global_settings, quota_availability, global_email_filter,
register_ticket_secret_generators, gift_card_transaction_display,
register_text_placeholders, register_mail_placeholders, device_info_updated,
register_event_permission_groups, register_organizer_permission_groups
register_event_permission_groups, register_organizer_permission_groups, self_service_cancellation_checks
Order events
""""""""""""
+1
View File
@@ -129,6 +129,7 @@ dev = [
"pytest==9.1.*",
"playwright",
"responses",
"django-stubs-ext"
]
[project.entry-points."distutils.commands"]
+1 -1
View File
@@ -349,7 +349,7 @@ class Cancellation(models.Model):
)
cancellation_state = models.CharField(
max_length=8,
max_length=16,
choices=CANCELLATION_STATE,
default=CREATED,
verbose_name=_("State of the cancellation"),
+1 -1
View File
@@ -301,7 +301,7 @@ def ensure_no_queries():
:return:
"""
def blocker(*args, **kwargs):
if settings.DEBUG or "PYTEST_CURRENT_TEST" in os.environ:
if settings.DEBUG or "PYTEST_CURRENT_TEST" in os.environ and not "ENSURE_NO_QUERIES_OVERRIDE" in os.environ:
raise RuntimeError(f"Unexpected DB query: {args[1]}")
logger.error("Unexpected DB query: %s", args[1])
+2
View File
@@ -7,6 +7,7 @@ No mocking is used: every test runs against a real database connection via the
"""
import logging
import os
import pytest
from django_scopes import scopes_disabled
@@ -28,6 +29,7 @@ def test_raises_runtime_error_in_debug(settings):
@pytest.mark.django_db
def test_logs_error_when_not_debug(settings, caplog):
settings.DEBUG = False
os.environ.setdefault("ENSURE_NO_QUERIES_OVERRIDE", "true")
with caplog.at_level(logging.ERROR):
with scopes_disabled():