mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-22 17:41:08 +00:00
Fixes test mocks
This commit is contained in:
parent
23188dfc5f
commit
6d258d5445
1 changed files with 12 additions and 2 deletions
|
@ -127,7 +127,12 @@ class UserViews(TestCase):
|
|||
validate_html(result.render())
|
||||
self.assertEqual(result.status_code, 200)
|
||||
|
||||
with patch("bookwyrm.views.user.is_api_request") as is_api:
|
||||
def test_followers_page_ap(self):
|
||||
"""JSON response"""
|
||||
view = views.Relationships.as_view()
|
||||
request = self.factory.get("")
|
||||
request.user = self.local_user
|
||||
with patch("bookwyrm.views.relationships.is_api_request") as is_api:
|
||||
is_api.return_value = True
|
||||
result = view(request, "mouse", "followers")
|
||||
|
||||
|
@ -173,7 +178,12 @@ class UserViews(TestCase):
|
|||
validate_html(result.render())
|
||||
self.assertEqual(result.status_code, 200)
|
||||
|
||||
with patch("bookwyrm.views.user.is_api_request") as is_api:
|
||||
def test_following_page_json(self):
|
||||
"""there are so many views, this just makes sure it LOADS"""
|
||||
view = views.Relationships.as_view()
|
||||
request = self.factory.get("")
|
||||
request.user = self.local_user
|
||||
with patch("bookwyrm.views.relationships.is_api_request") as is_api:
|
||||
is_api.return_value = True
|
||||
result = view(request, "mouse", "following")
|
||||
|
||||
|
|
Loading…
Reference in a new issue