Real test and update to tests

This commit is contained in:
simonwt 2026-04-16 22:20:11 +01:00
parent 41102d5348
commit e47a9aa568
3 changed files with 32 additions and 3 deletions

View file

@ -20,4 +20,24 @@ class TestFollow(unittest.TestCase):
self.assertIn("followType", result["payload"])
self.assertIn("preferences", result["payload"])
self.assertEqual(result["payload"]["isFollowing"], True)
self.assertEqual(result["payload"]["parent"]["pk"], "userprofile#janedoe")
self.assertEqual(result["payload"]["parentSlug"], "janedoe")
self.assertEqual(result["payload"]["parent"]["pk"], "userprofile#janedoe")
def test_unfollow(self):
result = follow(
entity='user',
is_following=False,
parent_slug='janedoe'
)
self.assertIsInstance(result, dict)
self.assertIn("job_function", result)
self.assertIn("payload", result)
self.assertEqual(result["job_function"], "follow.follow")
self.assertIsInstance(result["payload"], dict)
self.assertIn("isFollowing", result["payload"])
self.assertIn("parent", result["payload"])
self.assertIn("followType", result["payload"])
self.assertIn("preferences", result["payload"])
self.assertEqual(result["payload"]["isFollowing"], False)