forked from mirrors/bookwyrm
Uses empty queryset for forced no results mode
This commit is contained in:
parent
f94a3ec63b
commit
97aeaa9cd7
2 changed files with 3 additions and 3 deletions
|
@ -13,7 +13,7 @@ from bookwyrm.connectors import abstract_connector
|
|||
from bookwyrm.settings import DOMAIN
|
||||
|
||||
|
||||
class ShelfViews(TestCase):
|
||||
class Views(TestCase):
|
||||
"""tag views"""
|
||||
|
||||
def setUp(self):
|
||||
|
@ -127,7 +127,7 @@ class ShelfViews(TestCase):
|
|||
response = view(request)
|
||||
|
||||
response.render()
|
||||
self.assertEqual(response.context_data["results"], {})
|
||||
self.assertEqual(response.context_data["results"].object_list.count(), 0)
|
||||
|
||||
def test_search_lists(self):
|
||||
"""searches remote connectors"""
|
||||
|
|
|
@ -78,7 +78,7 @@ def user_search(query, viewer, *_):
|
|||
"""cool kids members only user search"""
|
||||
# logged out viewers can't search users
|
||||
if not viewer.is_authenticated:
|
||||
return {}
|
||||
return models.User.objects.none()
|
||||
|
||||
# use webfinger for mastodon style account@domain.com username to load the user if
|
||||
# they don't exist locally (handle_remote_webfinger will check the db)
|
||||
|
|
Loading…
Reference in a new issue