def test_find_open_checkout_for_user(customer_user, user_checkout): assert find_open_checkout_for_user(customer_user) == user_checkout checkout = Checkout.objects.create(user=customer_user) assert find_open_checkout_for_user(customer_user) == checkout assert not Checkout.objects.filter(pk=user_checkout.pk).exists()