예제 #1
0
    def user(self, db_session):
        user = models.User(authority="example.com",
                           username="******",
                           email="*****@*****.**")
        user.activation = models.Activation()
        db_session.add(user)
        db_session.flush()

        return user
예제 #2
0
    def test_User_activate_activates_user(self, db_session):
        user = models.User(authority="example.com",
                           username="******",
                           email="*****@*****.**")
        activation = models.Activation()
        user.activation = activation
        db_session.add(user)
        db_session.flush()

        user.activate()
        db_session.commit()

        assert user.is_activated
예제 #3
0
파일: user_test.py 프로젝트: yumatch/h
    def test_User_activate_activates_user(self, db_session):  # noqa: N802
        user = models.User(authority='example.com',
                           username='******',
                           email='*****@*****.**')
        activation = models.Activation()
        user.activation = activation
        db_session.add(user)
        db_session.flush()

        user.activate()
        db_session.commit()

        assert user.is_activated