API: Fix crash with deletion of cart positions with add-ons

This commit is contained in:
Raphael Michel
2022-10-25 12:08:58 +02:00
parent b99d21df69
commit 4983073172
2 changed files with 11 additions and 0 deletions

View File

@@ -167,6 +167,12 @@ def test_cp_delete(token_client, organizer, event, item, taxrule, question):
datetime=datetime.datetime(2018, 6, 11, 10, 0, 0, 0, tzinfo=UTC),
expires=datetime.datetime(2018, 6, 11, 10, 0, 0, 0, tzinfo=UTC)
)
CartPosition.objects.create(
event=event, cart_id="aaa@api", item=item, addon_to=cr,
price=23, attendee_name_parts={'full_name': 'Peter'},
datetime=datetime.datetime(2018, 6, 11, 10, 0, 0, 0, tzinfo=UTC),
expires=datetime.datetime(2018, 6, 11, 10, 0, 0, 0, tzinfo=UTC)
)
res = dict(TEST_CARTPOSITION_RES)
res["id"] = cr.pk
res["item"] = item.pk