-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
39782e7
commit fb74aa6
Showing
7 changed files
with
45 additions
and
2 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
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from django.test import TestCase | ||
from django.urls import reverse | ||
|
||
from bookmarks.tests.helpers import BookmarkFactoryMixin | ||
|
||
|
||
class CustomCssTestCase(TestCase, BookmarkFactoryMixin): | ||
def setUp(self): | ||
self.client.force_login(self.get_or_create_test_user()) | ||
|
||
def test_does_not_render_custom_style_tag_by_default(self): | ||
response = self.client.get(reverse("bookmarks:index")) | ||
self.assertNotContains(response, "<style>") | ||
|
||
def test_renders_custom_style_tag_if_user_has_custom_css(self): | ||
profile = self.get_or_create_test_user().profile | ||
profile.custom_css = "body { background-color: red; }" | ||
profile.save() | ||
|
||
response = self.client.get(reverse("bookmarks:index")) | ||
self.assertContains(response, "<style>body { background-color: red; }</style>") |
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