feat: improved order payment lifecycle

This commit is contained in:
2025-01-16 18:17:53 +01:00
parent ebb6d5a5a5
commit 6c60df2da0
7 changed files with 108 additions and 13 deletions
+11 -2
View File
@@ -4,14 +4,23 @@ from django.contrib.auth.models import User
from django.test import TestCase
from django.urls import reverse
from shop.models import Cart, CartItem, Order, CustomerAddress, ShippingMethod, ShopSettings
from shop.models import (
Cart,
CartItem,
Order,
CustomerAddress,
ShippingMethod,
ShopSettings,
)
from shop.tests.mixins import CreateProductsMixin
class TestOrders(TestCase, CreateProductsMixin):
def setUp(self):
self.product = self.create_product()
self.user = User.objects.create_user("anakin", "anakin@skywalker.com", "ihatesand")
self.user = User.objects.create_user(
"anakin", "anakin@skywalker.com", "ihatesand"
)
self.cart_for_user = self.create_cart(user=self.user)
self.anonymous_cart = self.create_cart()
self.address = CustomerAddress.objects.create(