def test_follow(self): #create two author object person_to_follow = Author() person_to_follow.save() person_following = Author() person_following.save() #call follow person_following.follow(person_to_follow) #assert person_to_follow and first element(there is only one) of person_following's following list self.assertEqual(person_following.following.all()[0], person_to_follow)
def test_get_following(self): #create two author object person_to_follow = Author() person_to_follow.save() person_following = Author() person_following.save() self.assertQuerysetEqual(person_following.following.all(), person_following.following.none()) person_following.follow(person_to_follow) following = person_following.get_following() self.assertEqual(following[0], person_to_follow)