From 4090b336db90778438a4a01c3c3e12b11caeb871 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 4 Jan 2021 10:20:49 -0800 Subject: [PATCH] Fixes outgoing test users --- bookwyrm/tests/test_incoming.py | 4 +++- bookwyrm/tests/test_outgoing.py | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/bookwyrm/tests/test_incoming.py b/bookwyrm/tests/test_incoming.py index 5cccbeb5d..980048bd4 100644 --- a/bookwyrm/tests/test_incoming.py +++ b/bookwyrm/tests/test_incoming.py @@ -19,7 +19,7 @@ class Incoming(TestCase): def setUp(self): ''' we need basic things, like users ''' self.local_user = models.User.objects.create_user( - 'mouse', 'mouse@mouse.com', 'mouseword', + 'mouse@example.com', 'mouse@mouse.com', 'mouseword', local=True, localname='mouse') self.local_user.remote_id = 'https://example.com/user/mouse' self.local_user.save() @@ -495,6 +495,8 @@ class Incoming(TestCase): incoming.handle_update_user({'object': userdata}) user = models.User.objects.get(id=self.local_user.id) self.assertEqual(user.name, 'MOUSE?? MOUSE!!') + self.assertEqual(user.username, 'mouse@example.com') + self.assertEqual(user.localname, 'mouse') def test_handle_update_edition(self): diff --git a/bookwyrm/tests/test_outgoing.py b/bookwyrm/tests/test_outgoing.py index caaba4e1e..344a374d4 100644 --- a/bookwyrm/tests/test_outgoing.py +++ b/bookwyrm/tests/test_outgoing.py @@ -21,14 +21,14 @@ class Outgoing(TestCase): self.factory = RequestFactory() with patch('bookwyrm.models.user.set_remote_server'): self.remote_user = models.User.objects.create_user( - 'rat', 'rat@rat.com', 'ratword', + 'rat', 'rat@email.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', ) self.local_user = models.User.objects.create_user( - 'mouse', 'mouse@mouse.com', 'mouseword', + 'mouse@local.com', 'mouse@mouse.com', 'mouseword', local=True, localname='mouse', remote_id='https://example.com/users/mouse', ) @@ -399,7 +399,8 @@ class Outgoing(TestCase): def test_handle_status_mentions(self): ''' @mention a user in a post ''' user = models.User.objects.create_user( - 'rat', 'rat@rat.com', 'password', local=True) + 'rat@local.com', 'rat@rat.com', 'password', + local=True, localname='rat') form = forms.CommentForm({ 'content': 'hi @rat', 'user': self.local_user.id, @@ -419,7 +420,8 @@ class Outgoing(TestCase): def test_handle_status_reply_with_mentions(self): ''' reply to a post with an @mention'ed user ''' user = models.User.objects.create_user( - 'rat', 'rat@rat.com', 'password', local=True) + 'rat@local.com', 'rat@rat.com', 'password', + local=True, localname='rat') form = forms.CommentForm({ 'content': 'hi @rat@example.com', 'user': self.local_user.id,