feat: add people sections and opt-in read more

This commit is contained in:
mohamad
2026-10-14 18:33:11 +03:30
parent 4bcb5f196d
commit 473637f477
33 changed files with 722 additions and 68 deletions
+15
View File
@@ -56,6 +56,21 @@ class ProductOverviewViewTest(ProductViewsSetup):
class MainProductDetailViewTest(ProductViewsSetup):
def test_read_more_can_be_set_per_article_and_section(self):
url = self.main_product.get_absolute_url()
article = Article.objects.create(main_product=self.main_product, title="Notes", description="Long notes")
section = ArticleSection.objects.create(article=article, title="Detail", value="Long detail")
response = self.client.get(url)
self.assertNotContains(response, 'data-readmore="260"')
self.assertNotContains(response, 'data-readmore="160"')
article.read_more_description = True
article.save(update_fields=["read_more_description"])
section.read_more_value = True
section.save(update_fields=["read_more_value"])
response = self.client.get(url)
self.assertContains(response, 'data-readmore="260"')
self.assertContains(response, 'data-readmore="160"')
def test_detail_returns_200(self):
url = reverse("products:main_product_detail", kwargs={"main_slug": "com2care"})
response = self.client.get(url)