Fixes tests

This commit is contained in:
Mouse Reeve
2020-11-28 11:52:00 -08:00
parent b0202eb8e8
commit 76ce20a5e0
2 changed files with 5 additions and 32 deletions

View File

@ -107,7 +107,7 @@ class Signature(TestCase):
status=200
)
with patch('bookwyrm.remote_user.get_remote_reviews.delay') as _:
with patch('bookwyrm.models.user.get_remote_reviews.delay') as _:
response = self.send_test_request(sender=self.fake_remote)
self.assertEqual(response.status_code, 200)
@ -145,7 +145,7 @@ class Signature(TestCase):
json=data,
status=200)
with patch('bookwyrm.remote_user.get_remote_reviews.delay') as _:
with patch('bookwyrm.models.user.get_remote_reviews.delay') as _:
# Key correct:
response = self.send_test_request(sender=self.fake_remote)
self.assertEqual(response.status_code, 200)
@ -177,7 +177,7 @@ class Signature(TestCase):
@pytest.mark.integration
def test_changed_data(self):
'''Message data must match the digest header.'''
with patch('bookwyrm.remote_user.fetch_user_data') as _:
with patch('bookwyrm.activitypub.resolve_remote_id') as _:
response = self.send_test_request(
self.mouse,
send_data=get_follow_data(self.mouse, self.cat))
@ -185,7 +185,7 @@ class Signature(TestCase):
@pytest.mark.integration
def test_invalid_digest(self):
with patch('bookwyrm.remote_user.fetch_user_data') as _:
with patch('bookwyrm.activitypub.resolve_remote_id') as _:
response = self.send_test_request(
self.mouse,
digest='SHA-256=AAAAAAAAAAAAAAAAAA')
@ -194,7 +194,7 @@ class Signature(TestCase):
@pytest.mark.integration
def test_old_message(self):
'''Old messages should be rejected to prevent replay attacks.'''
with patch('bookwyrm.remote_user.fetch_user_data') as _:
with patch('bookwyrm.activitypub.resolve_remote_id') as _:
response = self.send_test_request(
self.mouse,
date=http_date(time.time() - 301)