From 89d3c3e82b86a47709c0bf669695ed0ff82ba3ab Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 10 Apr 2021 11:49:45 -0700 Subject: [PATCH] Tests searching for users on blocked servers --- bookwyrm/tests/views/test_helpers.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bookwyrm/tests/views/test_helpers.py b/bookwyrm/tests/views/test_helpers.py index 7d2bc42c9..27d03832a 100644 --- a/bookwyrm/tests/views/test_helpers.py +++ b/bookwyrm/tests/views/test_helpers.py @@ -146,6 +146,15 @@ class ViewsHelpers(TestCase): self.assertIsInstance(result, models.User) self.assertEqual(result.username, "mouse@example.com") + def test_user_on_blocked_server(self, _): + """ find a remote user using webfinger """ + models.FederatedServer.objects.create( + server_name="example.com", status="blocked" + ) + + result = views.helpers.handle_remote_webfinger("@mouse@example.com") + self.assertIsNone(result) + def test_handle_reading_status_to_read(self, _): """ posts shelve activities """ shelf = self.local_user.shelf_set.get(identifier="to-read")