mirror of
https://github.com/Crocmagnon/checkout.git
synced 2024-12-22 14:11:48 +01:00
Sometimes generate dummy baskets without payment method
This commit is contained in:
parent
7f90eb9ec3
commit
5d27164f5d
1 changed files with 3 additions and 3 deletions
|
@ -35,9 +35,9 @@ class Command(BaseCommand):
|
|||
methods_weights = [random.randint(1, 6) for _ in range(len(payment_methods))]
|
||||
products_weights = [1 / product.display_order for product in products]
|
||||
for _ in range(count):
|
||||
method: PaymentMethod = random.choices(
|
||||
payment_methods, weights=methods_weights
|
||||
)[0]
|
||||
method = None
|
||||
if random.random() < 0.99:
|
||||
method = random.choices(payment_methods, weights=methods_weights)[0]
|
||||
basket = Basket.objects.create(payment_method=method)
|
||||
items = []
|
||||
item_count = int(random.normalvariate(3, 2))
|
||||
|
|
Loading…
Reference in a new issue