Skip to content

Commit

Permalink
Merge branch 'dev' into feature/main_page
Browse files Browse the repository at this point in the history
  • Loading branch information
michalkrzem authored Mar 16, 2024
2 parents 2b3f88e + c2b1605 commit c5ab4f0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Dshop/apps/products_catalogue/tests/test_products_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,19 @@ def test_filter_category(client, products):
@pytest.mark.django_db
def test_filter_by_min_price(client, products):
url = reverse("products-list")
response = client.get(f"{url}?prince__gt=5")
response = client.get(f"{url}?price__gt=5")
products = response.context['object_list']
for value in range(5, 10):
assert products[value].price == Decimal(value + 1)
for value, product in enumerate(products, start=6):
assert product.price == value


@pytest.mark.django_db
def test_filter_by_max_price(client, products):
url = reverse("products-list")
response = client.get(f"{url}?prince__lt=5")
response = client.get(f"{url}?price__lt=5")
products = response.context['object_list']
for idx, value in enumerate(range(5)):
assert products[idx].price == Decimal(value + 1)
for value, product in enumerate(products, start=1):
assert product.price == value


@pytest.mark.django_db
Expand Down

0 comments on commit c5ab4f0

Please sign in to comment.