fix: ordering

This commit is contained in:
2024-11-24 13:36:32 +01:00
parent 1f02858477
commit 7d80c64e40
9 changed files with 67 additions and 7 deletions
View File
+13
View File
@@ -0,0 +1,13 @@
from django.test import TestCase
from django.urls import reverse
from shop.tests.mixins import CreateProductsMixin
class TestWebComponents(TestCase, CreateProductsMixin):
def setUp(self):
self.product = self.create_product()
def test_list_products_component(self):
response = self.client.get(reverse("web:list_products"))
assert response.status_code == 200
+22
View File
@@ -0,0 +1,22 @@
from django.test import TestCase
from django.urls import reverse
from shop.tests.mixins import CreateProductsMixin
class TestIndex(TestCase, CreateProductsMixin):
def setUp(self):
self.product = self.create_product()
def test_index_view(self):
response = self.client.get(reverse("web:index"))
assert response.status_code == 200
def test_product_detail_view(self):
response = self.client.get(
reverse(
"web:product_detail",
kwargs={"pk": self.product.pk, "slug": self.product.slug},
)
)
assert response.status_code == 200