Make product cards fully clickable
All checks were successful
Build and Push Docker Image / build (push) Successful in 27s

This commit is contained in:
2026-06-16 00:06:21 +02:00
parent a84b9af926
commit 1188cef7be
11 changed files with 133 additions and 9 deletions

View File

@@ -279,6 +279,42 @@ class CatalogViewTests(TestCase):
response = self.client.get("/catalog/")
self.assertContains(response, 'href="/catalog/plumbing/kitchen-sink/"')
self.assertContains(
response,
'<a class="item-card-overlay" href="/catalog/plumbing/kitchen-sink/"',
html=False,
)
def test_sidebar_product_cards_include_full_card_links(self):
sale_item = Item.objects.create(
name="Акционная ванна",
slug="sale-bath",
category=self.plumbing,
price="900.00",
discount_price="750.00",
is_available=True,
)
new_item = Item.objects.create(
name="Новый душ",
slug="new-shower",
category=self.plumbing,
price="500.00",
is_available=True,
is_new=True,
)
response = self.client.get("/catalog/")
self.assertContains(
response,
f'<a class="sidebar-mini-card__overlay" href="/catalog/plumbing/{sale_item.slug}/"',
html=False,
)
self.assertContains(
response,
f'<a class="sidebar-mini-card__overlay" href="/catalog/plumbing/{new_item.slug}/"',
html=False,
)
def test_catalog_item_card_shows_favorite_button_for_authenticated_user(self):
user = get_user_model().objects.create_user(