mirror of
https://github.com/sissbruecker/linkding.git
synced 2025-08-07 10:58:25 +02:00

* Allow marking bookmarks as shared * Add basic share view * Ensure tag names in tag cloud are unique * Filter shared bookmarks by user * Add link for filtering by user * Prevent n+1 queries when rendering bookmark list * Prevent empty query params in return URL * Fix user select template tag name * Create shared bookmarks through API * List shared bookmarks through API * Show bookmark suggestions for shared view * Show unique tags in search suggestions * Sort user options * Add bookmark sharing feature flag * Add test for share setting default * Simplify settings view
18 lines
685 B
Python
18 lines
685 B
Python
from django.contrib.auth.models import User
|
|
from django.test import TestCase
|
|
|
|
from bookmarks.models import UserProfile
|
|
|
|
|
|
class UserProfileTestCase(TestCase):
|
|
|
|
def test_create_user_should_init_profile(self):
|
|
user = User.objects.create_user('testuser', 'test@example.com', 'password123')
|
|
profile = UserProfile.objects.all().filter(user_id=user.id).first()
|
|
self.assertIsNotNone(profile)
|
|
|
|
def test_bookmark_sharing_is_disabled_by_default(self):
|
|
user = User.objects.create_user('testuser', 'test@example.com', 'password123')
|
|
profile = UserProfile.objects.all().filter(user_id=user.id).first()
|
|
self.assertFalse(profile.enable_sharing)
|