diff --git a/bookwyrm/tests/test_remote_user.py b/bookwyrm/tests/test_remote_user.py deleted file mode 100644 index febf9f67c..000000000 --- a/bookwyrm/tests/test_remote_user.py +++ /dev/null @@ -1,27 +0,0 @@ -import json -import pathlib -from django.test import TestCase - -from bookwyrm import models, remote_user - - -class RemoteUser(TestCase): - ''' not too much going on in the books model but here we are ''' - def setUp(self): - self.remote_user = models.User.objects.create_user( - 'rat', 'rat@rat.com', 'ratword', - local=False, - remote_id='https://example.com/users/rat', - inbox='https://example.com/users/rat/inbox', - outbox='https://example.com/users/rat/outbox', - ) - datafile = pathlib.Path(__file__).parent.joinpath( - 'data/ap_user.json' - ) - self.user_data = json.loads(datafile.read_bytes()) - - - def test_get_remote_user(self): - actor = 'https://example.com/users/rat' - user = remote_user.get_or_create_remote_user(actor) - self.assertEqual(user, self.remote_user) diff --git a/bookwyrm/tests/test_signing.py b/bookwyrm/tests/test_signing.py index a5039306b..129a4333c 100644 --- a/bookwyrm/tests/test_signing.py +++ b/bookwyrm/tests/test_signing.py @@ -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)