Updates and tests outgoing reject

This commit is contained in:
Mouse Reeve
2020-10-16 14:28:25 -07:00
parent a567bd4e61
commit 75c695b3c6
4 changed files with 28 additions and 6 deletions

View File

@ -52,3 +52,21 @@ class Following(TestCase):
)
# follow relationship should exist
self.assertEqual(self.remote_user.followers.first(), self.local_user)
def test_handle_reject(self):
rel = models.UserFollowRequest.objects.create(
user_subject=self.local_user,
user_object=self.remote_user
)
rel_id = rel.id
outgoing.handle_reject(rel)
# request should be deleted
self.assertEqual(
models.UserFollowRequest.objects.filter(id=rel_id).count(), 0
)
# follow relationship should not exist
self.assertEqual(
models.UserFollows.objects.filter(id=rel_id).count(), 0
)