mirror of
https://github.com/sissbruecker/linkding.git
synced 2025-08-08 03:08:29 +02:00
Show URL as fallback if no title is available (#64)
This commit is contained in:
16
bookmarks/tests/test_bookmarks_model.py
Normal file
16
bookmarks/tests/test_bookmarks_model.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from django.test import TestCase
|
||||
|
||||
from bookmarks.models import Bookmark
|
||||
|
||||
|
||||
class BookmarkTestCase(TestCase):
|
||||
|
||||
def test_bookmark_resolved_title(self):
|
||||
bookmark = Bookmark(title='Custom title', website_title='Website title', url='https://example.com')
|
||||
self.assertEqual(bookmark.resolved_title, 'Custom title')
|
||||
|
||||
bookmark = Bookmark(title='', website_title='Website title', url='https://example.com')
|
||||
self.assertEqual(bookmark.resolved_title, 'Website title')
|
||||
|
||||
bookmark = Bookmark(title='', website_title='', url='https://example.com')
|
||||
self.assertEqual(bookmark.resolved_title, 'https://example.com')
|
Reference in New Issue
Block a user