Beispiel #1
0
    def test_following(self):

        user = User()

        assert user.following == set()

        user.following = set([1])

        assert user.following == set([1])
Beispiel #2
0
    def test_following(self):

        user = User()

        assert user.following == set()

        user.following = set([1])

        assert user.following == set([1])
Beispiel #3
0
    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)
Beispiel #4
0
    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)