1
0
Fork 0

fix reject PR

- rationalise activitypub.Reject and fix model being undefined
- fix not being able to follow users from followers page: 'delete' option now in user_options dropdown
- revert bookwyrm.js
- fix delete_follow_request deleting instead of rejecting
- add user id to 'remove-follow' path
This commit is contained in:
Hugh Rundle 2023-11-21 20:13:56 +11:00
parent 2ba0e3d7ff
commit 2c9ebba5d7
No known key found for this signature in database
GPG key ID: A7E35779918253F9
8 changed files with 49 additions and 67 deletions

View file

@ -180,6 +180,18 @@ class FollowViews(TestCase):
# follow relationship should not exist
self.assertEqual(models.UserFollows.objects.filter(id=rel.id).count(), 0)
def test_handle_reject_existing(self, *_):
"""reject a follow previously approved"""
request = self.factory.post("", {"user": self.remote_user.username})
request.user = self.local_user
rel = models.UserFollows.objects.create(
user_subject=self.remote_user, user_object=self.local_user
)
with patch("bookwyrm.models.activitypub_mixin.broadcast_task.apply_async"):
views.remove_follow(request, self.remote_user.id)
# follow relationship should not exist
self.assertEqual(models.UserFollows.objects.filter(id=rel.id).count(), 0)
def test_ostatus_follow_request(self, *_):
"""check ostatus subscribe template loads"""
request = self.factory.get(