Compare commits

..

No commits in common. "4e3abbdc3d958a3208b9938ff0906a43d88ea74c" and "ec29d95b8ef8441f6edac07d2e611797c7a4e0a7" have entirely different histories.

6 changed files with 16 additions and 14 deletions

View file

@ -40,7 +40,7 @@ repos:
hooks: hooks:
- id: djhtml - id: djhtml
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.1 rev: v0.5.7
hooks: hooks:
- id: ruff - id: ruff
args: [--fix] args: [--fix]

View file

@ -56,9 +56,9 @@ idna==3.7
# via requests # via requests
kiwisolver==1.4.5 kiwisolver==1.4.5
# via matplotlib # via matplotlib
matplotlib==3.9.2 matplotlib==3.9.1.post1
# via -r requirements.in # via -r requirements.in
numpy==2.1.0 numpy==2.0.1
# via # via
# contourpy # contourpy
# matplotlib # matplotlib

View file

@ -39,7 +39,7 @@ django==5.1
# via # via
# -c constraints.txt # -c constraints.txt
# model-bakery # model-bakery
factory-boy==3.3.1 factory-boy==3.3.0
# via -r requirements-dev.in # via -r requirements-dev.in
faker==27.0.0 faker==27.0.0
# via factory-boy # via factory-boy
@ -62,7 +62,7 @@ jinja2==3.1.4
# via pytest-html # via pytest-html
markupsafe==2.1.5 markupsafe==2.1.5
# via jinja2 # via jinja2
model-bakery==1.19.3 model-bakery==1.19.1
# via -r requirements-dev.in # via -r requirements-dev.in
mypy-extensions==1.0.0 mypy-extensions==1.0.0
# via black # via black
@ -133,7 +133,7 @@ requests==2.32.3
# -c constraints.txt # -c constraints.txt
# pytest-base-url # pytest-base-url
# pytest-selenium # pytest-selenium
ruff==0.6.1 ruff==0.5.7
# via -r requirements-dev.in # via -r requirements-dev.in
selenium==4.23.1 selenium==4.23.1
# via # via
@ -178,5 +178,5 @@ wsproto==1.2.0
# The following packages are considered to be unsafe in a requirements file: # The following packages are considered to be unsafe in a requirements file:
pip==24.2 pip==24.2
# via pip-tools # via pip-tools
setuptools==72.2.0 setuptools==72.1.0
# via pip-tools # via pip-tools

View file

@ -56,9 +56,9 @@ idna==3.7
# via requests # via requests
kiwisolver==1.4.5 kiwisolver==1.4.5
# via matplotlib # via matplotlib
matplotlib==3.9.2 matplotlib==3.9.1.post1
# via -r requirements.in # via -r requirements.in
numpy==2.1.0 numpy==2.0.1
# via # via
# contourpy # contourpy
# matplotlib # matplotlib

View file

@ -7,7 +7,7 @@ def _collectstatic():
call_command("collectstatic", interactive=False, verbosity=0) call_command("collectstatic", interactive=False, verbosity=0)
@pytest.fixture @pytest.fixture()
def live_server(settings, live_server): def live_server(settings, live_server):
settings.STORAGES = { settings.STORAGES = {
"default": { "default": {
@ -20,13 +20,13 @@ def live_server(settings, live_server):
return live_server return live_server
@pytest.fixture @pytest.fixture()
def firefox_options(firefox_options): def firefox_options(firefox_options):
firefox_options.add_argument("-headless") firefox_options.add_argument("-headless")
return firefox_options return firefox_options
@pytest.fixture @pytest.fixture()
def selenium(selenium): def selenium(selenium):
selenium.implicitly_wait(3) selenium.implicitly_wait(3)
selenium.set_window_size(3860, 2140) selenium.set_window_size(3860, 2140)

View file

@ -40,8 +40,10 @@ class Command(BaseCommand):
method = random.choices(payment_methods, weights=methods_weights)[0] method = random.choices(payment_methods, weights=methods_weights)[0]
basket = Basket.objects.create(payment_method=method) basket = Basket.objects.create(payment_method=method)
items_in_basket = int(random.normalvariate(3, 2)) items_in_basket = int(random.normalvariate(3, 2))
items_in_basket = min(items_in_basket, len(products)) if items_in_basket > len(products):
items_in_basket = max(items_in_basket, 1) items_in_basket = len(products)
if items_in_basket < 1:
items_in_basket = 1
rng = np.random.default_rng() rng = np.random.default_rng()
selected_products = rng.choice( selected_products = rng.choice(
products, products,