Fix test_checkoutflow

This commit is contained in:
Raphael Michel
2017-09-13 18:29:08 +02:00
parent ed35c4f74e
commit 00834cd5e0
2 changed files with 4 additions and 3 deletions

View File

@@ -158,7 +158,7 @@ def get_cart_total(request):
else: else:
request._cart_total_cache = CartPosition.objects.filter( request._cart_total_cache = CartPosition.objects.filter(
cart_id=request.session.session_key, event=request.event cart_id=request.session.session_key, event=request.event
).aggregate(sum=Sum('price'))['sum'] ).aggregate(sum=Sum('price'))['sum'] or 0
return request._cart_total_cache return request._cart_total_cache

View File

@@ -94,8 +94,9 @@ def test_step_ignored(event, mocker, req_with_session):
flow = with_mocked_step(mocker, MockingStep, event) flow = with_mocked_step(mocker, MockingStep, event)
req_with_session.event = event req_with_session.event = event
assert flow[1].get_next_applicable(req_with_session) is flow[3] assert flow[1].get_next_applicable(req_with_session) is flow[4]
assert flow[1] is flow[3].get_prev_applicable(req_with_session) # flow[3] is also skipped because no payment is required if there is no cart
assert flow[1] is flow[4].get_prev_applicable(req_with_session)
@pytest.mark.django_db @pytest.mark.django_db