From 750cedd078e437a1c1bde612c41068cefd861a28 Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Mon, 21 Oct 2024 12:41:16 +1100 Subject: [PATCH] fix failing test --- bookwyrm/tests/activitypub/test_base_activity.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bookwyrm/tests/activitypub/test_base_activity.py b/bookwyrm/tests/activitypub/test_base_activity.py index 4c29c45ef..23240fd4f 100644 --- a/bookwyrm/tests/activitypub/test_base_activity.py +++ b/bookwyrm/tests/activitypub/test_base_activity.py @@ -155,9 +155,19 @@ class BaseActivity(TestCase): result = resolve_remote_id( "https://example.com/user/moose", model=models.User ) + + self.assertTrue( + models.User.objects.filter( + remote_id="https://example.com/user/moose" + ).exists() + ) # moose has been added to DB + self.assertTrue( + models.User.objects.filter( + remote_id="https://example.com/user/ali" + ).exists() + ) # Ali has been added to DB self.assertIsInstance(result, models.User) self.assertEqual(result.name, "moose?? moose!!") - self.assertEqual(models.User.objects.count(), 3) # created moose plus the alias alias = models.User.objects.last() self.assertEqual(alias.name, "Ali As") self.assertEqual(result.also_known_as.first(), alias) # Ali is alias of Moose