def test_following(self): user = User() assert user.following == set() user.following = set([1]) assert user.following == set([1])
def test_get_following(self): user = User(username="******", email="*****@*****.**") db.session.add(user) assert user.get_following().count() == 0 user2 = User(username="******", email="*****@*****.**") db.session.add(user2) db.session.commit() user.following = set([user2.id]) assert user.get_following().count() == 1 assert user.get_following().first().id == user2.id assert user.is_following(user2)