コード例 #1
0
 def setUp(self):
     app = Flask(__name__)
     self.db_fd, self.path = tempfile.mkstemp()
     app.config['DEBUG'] = True
     app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///%s" % (self.path)
     app.register_blueprint(lark_admin_api, url_prefix='/admin')
     self.app = app
     self.request_ctx = self.app.test_request_context()
     self.request_ctx.push()
     db.create_all()
コード例 #2
0
    def setUp(self):
        app = Flask(__name__)
        self.db_fd, self.path = tempfile.mkstemp()
        app.config['DEBUG'] = True
        app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///%s" % (self.path)
        app.register_blueprint(lark_admin_api, url_prefix='/admin')
        self.app = app
        self.client = app.test_client()
        self.request_ctx = self.app.test_request_context()
        self.request_ctx.push()
        db.create_all()
        self.client = app.test_client()

        user = User.create_user(username='******', password='******')
        self.user = user
        user2 = User.create_user(username='******', password='******')
        self.user2 = user2
        client = Client.create_from_user(user, {
            'name': 'Test Test',
            'description': 'test is testy',
            'redirect_uris': ['http://localhost:8000'],
        })
        self.oauth_client = client