fix: show product in replacement of sub products in homepage
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from django.test import TestCase
|
||||
from django.urls import reverse
|
||||
|
||||
from apps.pages.models import CustomPage, CustomPageSection
|
||||
from apps.pages.models import CustomPage, CustomPageSection, CustomPageSectionItem
|
||||
|
||||
|
||||
class CustomPageViewTest(TestCase):
|
||||
@@ -40,6 +40,26 @@ class CustomPageViewTest(TestCase):
|
||||
response = self.client.get(reverse("pages:custom_page", kwargs={"slug": "missing"}))
|
||||
self.assertEqual(response.status_code, 404)
|
||||
|
||||
def test_section_item_with_url_renders_as_link(self):
|
||||
section = CustomPageSection.objects.create(
|
||||
page=self.page,
|
||||
section_type=CustomPageSection.TYPE_FEATURES,
|
||||
title="Highlights",
|
||||
is_active=True,
|
||||
)
|
||||
CustomPageSectionItem.objects.create(
|
||||
page=self.page,
|
||||
section=section,
|
||||
title="Documentation",
|
||||
content="Read the docs.",
|
||||
url="/about/",
|
||||
order=1,
|
||||
)
|
||||
response = self.client.get(reverse("pages:custom_page", kwargs={"slug": "resources"}))
|
||||
self.assertContains(response, 'href="/about/"')
|
||||
self.assertContains(response, "section-item-link")
|
||||
self.assertContains(response, "Documentation")
|
||||
|
||||
|
||||
class CustomPageNavTest(TestCase):
|
||||
def test_nav_custom_pages_in_context(self):
|
||||
|
||||
Reference in New Issue
Block a user