Exemple #1
0
def test_get_anonymous_checkout_from_token(anonymous_checkout, user_checkout):
    checkout = utils.get_anonymous_checkout_from_token(anonymous_checkout.token)
    assert Checkout.objects.all().count() == 2
    assert checkout == anonymous_checkout

    # test against new token
    checkout = utils.get_anonymous_checkout_from_token(uuid4())
    assert Checkout.objects.all().count() == 2
    assert checkout is None

    # test against getting checkout assigned to user
    checkout = utils.get_anonymous_checkout_from_token(user_checkout.token)
    assert Checkout.objects.all().count() == 2
    assert checkout is None
Exemple #2
0
def test_get_anonymous_checkout_from_token(anonymous_checkout, user_checkout):
    checkout = utils.get_anonymous_checkout_from_token(anonymous_checkout.token)
    assert Checkout.objects.all().count() == 2
    assert checkout == anonymous_checkout

    # test against new token
    checkout = utils.get_anonymous_checkout_from_token(uuid4())
    assert Checkout.objects.all().count() == 2
    assert checkout is None

    # test against getting checkout assigned to user
    checkout = utils.get_anonymous_checkout_from_token(user_checkout.token)
    assert Checkout.objects.all().count() == 2
    assert checkout is None