Skip to content

Commit

Permalink
tweak test a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
sissbruecker committed Apr 17, 2024
1 parent cfeab75 commit 865d496
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions bookmarks/tests/test_bookmark_new_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,27 +211,24 @@ def test_should_hide_notes_if_there_are_no_notes(self):

self.assertContains(response, '<details class="notes">', count=1)

def test_should_set_mark_unread_to_user_set_option_as_true(self):
self.user.profile.default_mark_unread = True
self.user.profile.save()

def test_should_not_check_unread_by_default(self):
response = self.client.get(reverse("bookmarks:new"))
html = response.content.decode()

self.assertInHTML(
'<input type="checkbox" name="unread" value="true" '
'id="id_unread" checked="">',
'<input type="checkbox" name="unread" id="id_unread">',
html,
)

def test_should_set_mark_unread_to_user_set_option_as_false(self):
self.user.profile.default_mark_unread = False
def test_should_check_unread_when_configured_in_profile(self):
self.user.profile.default_mark_unread = True
self.user.profile.save()

response = self.client.get(reverse("bookmarks:new"))
html = response.content.decode()

self.assertInHTML(
'<input type="checkbox" name="unread" id="id_unread">',
'<input type="checkbox" name="unread" value="true" '
'id="id_unread" checked="">',
html,
)

0 comments on commit 865d496

Please sign in to comment.