-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #789 from maykinmedia/feature/1656-categories-wysiwyg
[#1656] Added CKEditor widget to category description field
- Loading branch information
Showing
6 changed files
with
34 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,15 +8,15 @@ | |
|
||
|
||
@override_settings(ROOT_URLCONF="open_inwoner.cms.tests.urls") | ||
class TestCategoryListView(TestCase): | ||
class CategoryListViewTest(TestCase): | ||
@classmethod | ||
def setUpTestData(cls): | ||
cls.user = UserFactory() | ||
cls.user.set_password("12345") | ||
cls.user.email = "[email protected]" | ||
cls.user.save() | ||
|
||
def test_access_restricted(self): | ||
def test_category_list_view_access_restricted(self): | ||
config = SiteConfiguration.get_solo() | ||
config.hide_categories_from_anonymous_users = True | ||
config.save() | ||
|
@@ -36,7 +36,7 @@ def test_access_restricted(self): | |
|
||
self.assertEqual(response.status_code, 200) | ||
|
||
def test_access_not_restricted(self): | ||
def test_category_list_view_access_not_restricted(self): | ||
config = SiteConfiguration.get_solo() | ||
config.hide_categories_from_anonymous_users = False | ||
config.save() | ||
|
@@ -50,17 +50,20 @@ def test_access_not_restricted(self): | |
|
||
|
||
@override_settings(ROOT_URLCONF="open_inwoner.cms.tests.urls") | ||
class TestCategoryDetailView(TestCase): | ||
class CategoryDetailViewTest(TestCase): | ||
@classmethod | ||
def setUpTestData(cls): | ||
cls.user = UserFactory() | ||
cls.user.set_password("12345") | ||
cls.user.email = "[email protected]" | ||
cls.user.save() | ||
|
||
cls.category = CategoryFactory.create(name="test cat") | ||
cls.category = CategoryFactory.create( | ||
name="test cat", | ||
description="A <em>descriptive</em> description", | ||
) | ||
|
||
def test_access_restricted(self): | ||
def test_category_detail_view_access_restricted(self): | ||
config = SiteConfiguration.get_solo() | ||
config.hide_categories_from_anonymous_users = True | ||
config.save() | ||
|
@@ -80,7 +83,7 @@ def test_access_restricted(self): | |
|
||
self.assertEqual(response.status_code, 200) | ||
|
||
def test_access_not_restricted(self): | ||
def test_category_detail_view_access_not_restricted(self): | ||
config = SiteConfiguration.get_solo() | ||
config.hide_categories_from_anonymous_users = False | ||
config.save() | ||
|
@@ -91,3 +94,17 @@ def test_access_not_restricted(self): | |
response = self.client.get(url) | ||
|
||
self.assertEqual(response.status_code, 200) | ||
|
||
def test_category_detail_description_rendered(self): | ||
url = reverse("products:category_detail", kwargs={"slug": self.category.slug}) | ||
|
||
response = self.client.get(url) | ||
|
||
self.assertIn( | ||
'<p class="p">A <em>descriptive</em> description</p>', | ||
response.rendered_content, | ||
) | ||
self.assertNotIn( | ||
'[<p class="p">A <em>descriptive</em> description</p>, <em>descriptive</em>]', | ||
response.rendered_content, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters