Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix failing test from #3432 #3460

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading