Add option for showing bookmark description as separate block (#663)

* Add option for showing bookmark description as separate block

* Use context
This commit is contained in:
Sascha Ißbrücker
2024-03-24 21:31:15 +01:00
committed by GitHub
parent ec34cc523f
commit 9df80e01de
9 changed files with 362 additions and 35 deletions

View File

@@ -24,6 +24,8 @@ class SettingsGeneralViewTestCase(TestCase, BookmarkFactoryMixin):
form_data = {
"theme": UserProfile.THEME_AUTO,
"bookmark_date_display": UserProfile.BOOKMARK_DATE_DISPLAY_RELATIVE,
"bookmark_description_display": UserProfile.BOOKMARK_DESCRIPTION_DISPLAY_INLINE,
"bookmark_description_max_lines": 1,
"bookmark_link_target": UserProfile.BOOKMARK_LINK_TARGET_BLANK,
"web_archive_integration": UserProfile.WEB_ARCHIVE_INTEGRATION_DISABLED,
"enable_sharing": False,
@@ -56,6 +58,8 @@ class SettingsGeneralViewTestCase(TestCase, BookmarkFactoryMixin):
"update_profile": "",
"theme": UserProfile.THEME_DARK,
"bookmark_date_display": UserProfile.BOOKMARK_DATE_DISPLAY_HIDDEN,
"bookmark_description_display": UserProfile.BOOKMARK_DESCRIPTION_DISPLAY_SEPARATE,
"bookmark_description_max_lines": 3,
"bookmark_link_target": UserProfile.BOOKMARK_LINK_TARGET_SELF,
"web_archive_integration": UserProfile.WEB_ARCHIVE_INTEGRATION_ENABLED,
"enable_sharing": True,
@@ -76,6 +80,14 @@ class SettingsGeneralViewTestCase(TestCase, BookmarkFactoryMixin):
self.assertEqual(
self.user.profile.bookmark_date_display, form_data["bookmark_date_display"]
)
self.assertEqual(
self.user.profile.bookmark_description_display,
form_data["bookmark_description_display"],
)
self.assertEqual(
self.user.profile.bookmark_description_max_lines,
form_data["bookmark_description_max_lines"],
)
self.assertEqual(
self.user.profile.bookmark_link_target, form_data["bookmark_link_target"]
)