chore: refactor settings
This commit is contained in:
@@ -35,14 +35,14 @@ class ShopModelsTest(TestCase):
|
||||
|
||||
def test_create_order(self):
|
||||
self.customer = Customer.objects.create(
|
||||
first_name='Luke',
|
||||
last_name='Skywalker',
|
||||
vat_id='11111111H',
|
||||
address='Farm Skywalker',
|
||||
city='Desert',
|
||||
state='Mos-Eisley',
|
||||
zip='00001',
|
||||
country='Tatooine',
|
||||
first_name="Luke",
|
||||
last_name="Skywalker",
|
||||
vat_id="11111111H",
|
||||
address="Farm Skywalker",
|
||||
city="Desert",
|
||||
state="Mos-Eisley",
|
||||
zip="00001",
|
||||
country="Tatooine",
|
||||
)
|
||||
|
||||
l1 = create_order_line_for_product(
|
||||
|
||||
+12
-16
@@ -22,20 +22,18 @@ def create_order_line_for_product(product: Product, quantity: Decimal, tax: Tax)
|
||||
|
||||
|
||||
def create_order(
|
||||
customer: Customer,
|
||||
lines: Iterable,
|
||||
|
||||
billing_address: str,
|
||||
billing_city: str,
|
||||
billing_state: str,
|
||||
billing_country: str,
|
||||
billing_zip: str,
|
||||
|
||||
shipping_address: str = '',
|
||||
shipping_city: str = '',
|
||||
shipping_state: str = '',
|
||||
shipping_country: str = '',
|
||||
shipping_zip: str = '',
|
||||
customer: Customer,
|
||||
lines: Iterable,
|
||||
billing_address: str,
|
||||
billing_city: str,
|
||||
billing_state: str,
|
||||
billing_country: str,
|
||||
billing_zip: str,
|
||||
shipping_address: str = "",
|
||||
shipping_city: str = "",
|
||||
shipping_state: str = "",
|
||||
shipping_country: str = "",
|
||||
shipping_zip: str = "",
|
||||
) -> Order:
|
||||
billing_address = billing_address if billing_address else customer.address
|
||||
billing_city = billing_city if billing_city else customer.city
|
||||
@@ -51,13 +49,11 @@ def create_order(
|
||||
|
||||
order = Order.objects.create(
|
||||
customer=customer,
|
||||
|
||||
billing_address=billing_address,
|
||||
billing_city=billing_city,
|
||||
billing_state=billing_state,
|
||||
billing_country=billing_country,
|
||||
billing_zip=billing_zip,
|
||||
|
||||
shipping_address=shipping_address,
|
||||
shipping_city=shipping_city,
|
||||
shipping_state=shipping_state,
|
||||
|
||||
Reference in New Issue
Block a user