Skip to content

Commit

Permalink
Merge pull request #3460 from hughrun/3426
Browse files Browse the repository at this point in the history
fix failing test from #3432
  • Loading branch information
mouse-reeve authored Oct 21, 2024
2 parents 14dba48 + 750cedd commit d16faac
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion bookwyrm/tests/activitypub/test_base_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,19 @@ def test_resolve_remote_alias(self, *_):
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
Expand Down

0 comments on commit d16faac

Please sign in to comment.