コード例 #1
0
    def setUpClass(cls):
        with app.app_context():
            db.drop_all()
            db.create_all()

            cls.test_client = app.test_client()
            cls.test_dao = UserDAO()
コード例 #2
0
    def setUpClass(cls):
        with app.app_context():
            db.drop_all()
            db.create_all()

            cls.test_dao = UserDAO()

            test_user = User('*****@*****.**', 'testpw',
                             'test-{0}-username'.format(uuid.uuid4()))

            deleted_user = User('*****@*****.**', 'testpassword',
                                'test-{0}-username'.format(uuid.uuid4()))
            deleted_user.is_deleted = True

            user_to_delete = User('*****@*****.**', 'testpw',
                                  'test-{0}-username'.format(uuid.uuid4()))

            cls.test_uid = test_user.public_id
            cls.deleted_uid = deleted_user.public_id
            cls.to_delete_uid = user_to_delete.public_id

            db.session.add(test_user)
            db.session.add(deleted_user)
            db.session.add(user_to_delete)
            db.session.commit()
コード例 #3
0
    def setUpClass(cls):
        with app.app_context():
            db.drop_all()
            db.create_all()

            cls.test_client = app.test_client()
            cls.test_dao = UserDAO()

            test_user = User('*****@*****.**', 'testpw', 'test-verify')

            cls.test_user_token = test_user.verify_token
            cls.test_uid = test_user.public_id

            db.session.add(test_user)
            db.session.commit()
コード例 #4
0
 def tearDownClass(cls):
     with app.app_context():
         db.drop_all()