add failing test for SUBEVENT_MODE_SAME

This commit is contained in:
Mira Weller
2024-10-01 17:28:42 +02:00
parent e51927c4e0
commit 94733135f0
2 changed files with 200 additions and 12 deletions

View File

@@ -40,7 +40,7 @@ class DummyCategory:
def __init__(self, category: ItemCategory, subevent=None):
self.id = category.id
self.name = category.name + (f" ({subevent})" if subevent else "")
self.name = str(category.name) + (f" ({subevent})" if subevent else "")
self.description = category.description
@@ -63,10 +63,12 @@ class CrossSellingService:
)
else:
result = (
(category, self._prepare_items(None, items_qs, discount_info))
(category,
self._prepare_items(None, items_qs, discount_info),
None)
for (category, items_qs, discount_info) in self._applicable_categories
)
return [(category, items) for (category, items) in result if len(items) > 0]
return [(category, items, form_prefix) for (category, items, form_prefix) in result if len(items) > 0]
@property
def _applicable_categories(self):