mirror of
https://github.com/Crocmagnon/checkout.git
synced 2024-11-22 08:08:04 +01:00
Fix product categories
This commit is contained in:
parent
55b6cb9cb8
commit
a9599d504d
2 changed files with 2 additions and 7 deletions
|
@ -40,7 +40,7 @@ class ProductFactory(factory.django.DjangoModelFactory):
|
||||||
|
|
||||||
name = factory.Faker("text", max_nb_chars=80)
|
name = factory.Faker("text", max_nb_chars=80)
|
||||||
unit_price_cents = factory.LazyFunction(partial(random.randint, 80, 650))
|
unit_price_cents = factory.LazyFunction(partial(random.randint, 80, 650))
|
||||||
category = factory.Iterator(ProductCategory.objects.all())
|
category = factory.SubFactory(ProductCategoryFactory)
|
||||||
|
|
||||||
|
|
||||||
class PaymentMethodFactory(factory.django.DjangoModelFactory):
|
class PaymentMethodFactory(factory.django.DjangoModelFactory):
|
||||||
|
@ -54,7 +54,7 @@ class BasketWithItemsFactory(factory.django.DjangoModelFactory):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Basket
|
model = Basket
|
||||||
|
|
||||||
payment_method = factory.Iterator(PaymentMethod.objects.all())
|
payment_method = factory.SubFactory(PaymentMethodFactory)
|
||||||
|
|
||||||
@factory.post_generation
|
@factory.post_generation
|
||||||
def items(self, create, _extracted, **_kwargs):
|
def items(self, create, _extracted, **_kwargs):
|
||||||
|
|
|
@ -16,7 +16,6 @@ from purchase.tests.factories import (
|
||||||
BasketWithItemsFactory,
|
BasketWithItemsFactory,
|
||||||
CashierFactory,
|
CashierFactory,
|
||||||
PaymentMethodFactory,
|
PaymentMethodFactory,
|
||||||
ProductCategoryFactory,
|
|
||||||
ProductFactory,
|
ProductFactory,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -31,8 +30,6 @@ def test_cashier_create_and_update_basket( # noqa: PLR0915
|
||||||
|
|
||||||
# Setup data
|
# Setup data
|
||||||
cashier = CashierFactory()
|
cashier = CashierFactory()
|
||||||
ProductCategoryFactory()
|
|
||||||
ProductCategoryFactory()
|
|
||||||
products = [
|
products = [
|
||||||
ProductFactory(),
|
ProductFactory(),
|
||||||
ProductFactory(),
|
ProductFactory(),
|
||||||
|
@ -260,8 +257,6 @@ def test_baskets_list(live_server: LiveServer, selenium: WebDriver):
|
||||||
|
|
||||||
# Setup test data
|
# Setup test data
|
||||||
cashier = CashierFactory()
|
cashier = CashierFactory()
|
||||||
ProductCategoryFactory()
|
|
||||||
ProductCategoryFactory()
|
|
||||||
_ = [
|
_ = [
|
||||||
ProductFactory(),
|
ProductFactory(),
|
||||||
ProductFactory(),
|
ProductFactory(),
|
||||||
|
|
Loading…
Reference in a new issue