From bbbfbe721e03ef2bb6d88ffae6a2876fbf9d8599 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Thu, 3 Dec 2020 16:23:13 -0800 Subject: [PATCH] Removes update user test --- bookwyrm/tests/incoming/test_follow.py | 21 ------------- bookwyrm/tests/incoming/test_update_user.py | 34 --------------------- 2 files changed, 55 deletions(-) delete mode 100644 bookwyrm/tests/incoming/test_update_user.py diff --git a/bookwyrm/tests/incoming/test_follow.py b/bookwyrm/tests/incoming/test_follow.py index 8e0c7598e..799907dac 100644 --- a/bookwyrm/tests/incoming/test_follow.py +++ b/bookwyrm/tests/incoming/test_follow.py @@ -75,24 +75,3 @@ class IncomingFollow(TestCase): # the follow relationship should not exist follow = models.UserFollows.objects.all() self.assertEqual(list(follow), []) - - - def test_nonexistent_user_follow(self): - activity = { - "@context": "https://www.w3.org/ns/activitystreams", - "id": "https://example.com/users/rat/follows/123", - "type": "Follow", - "actor": "https://example.com/users/rat", - "object": "http://local.com/user/nonexistent-user" - } - - with patch('bookwyrm.broadcast.broadcast_task.delay') as _: - incoming.handle_follow(activity) - - # do nothing - notifications = models.Notification.objects.all() - self.assertEqual(list(notifications), []) - requests = models.UserFollowRequest.objects.all() - self.assertEqual(list(requests), []) - follows = models.UserFollows.objects.all() - self.assertEqual(list(follows), []) diff --git a/bookwyrm/tests/incoming/test_update_user.py b/bookwyrm/tests/incoming/test_update_user.py deleted file mode 100644 index 5e8b5f2ec..000000000 --- a/bookwyrm/tests/incoming/test_update_user.py +++ /dev/null @@ -1,34 +0,0 @@ -''' when a remote user changes their profile ''' -import json -import pathlib -from unittest.mock import patch -from django.test import TestCase - -from bookwyrm import models, incoming - - -class UpdateUser(TestCase): - def setUp(self): - with patch('bookwyrm.models.user.set_remote_server.delay'): - with patch('bookwyrm.models.user.get_remote_reviews.delay'): - self.user = models.User.objects.create_user( - 'mouse', 'mouse@mouse.com', 'mouseword', - remote_id='https://example.com/user/mouse', - local=False, - localname='mouse' - ) - - datafile = pathlib.Path(__file__).parent.joinpath( - '../data/ap_user.json' - ) - self.user_data = json.loads(datafile.read_bytes()) - - def test_handle_update_user(self): - self.assertIsNone(self.user.name) - self.assertEqual(self.user.localname, 'mouse') - - incoming.handle_update_user({'object': self.user_data}) - self.user = models.User.objects.get(id=self.user.id) - - self.assertEqual(self.user.name, 'MOUSE?? MOUSE!!') - self.assertEqual(self.user.localname, 'mouse')