def test_get_or_create_user_checkout(customer_user, anonymous_checkout, user_checkout, admin_user): checkout = utils.get_or_create_user_checkout(customer_user)[0] assert Checkout.objects.all().count() == 2 assert checkout == user_checkout # test against creating new checkouts Checkout.objects.create(user=admin_user) queryset = Checkout.objects.all() checkouts = list(queryset) checkout = utils.get_or_create_user_checkout(admin_user)[0] assert Checkout.objects.all().count() == 3 assert checkout in checkouts assert checkout.user == admin_user
def test_get_or_create_user_checkout( customer_user, anonymous_checkout, user_checkout, admin_user ): checkout = utils.get_or_create_user_checkout(customer_user)[0] assert Checkout.objects.all().count() == 2 assert checkout == user_checkout # test against creating new checkouts Checkout.objects.create(user=admin_user) queryset = Checkout.objects.all() checkouts = list(queryset) checkout = utils.get_or_create_user_checkout(admin_user)[0] assert Checkout.objects.all().count() == 3 assert checkout in checkouts assert checkout.user == admin_user