Пример #1
0
 def setUp(self):
     app = create_app('config.TestConfig')
     self.app = JWTManager(app)
     with app.test_request_context():
         self.access_token = create_access_token('test')
     self.client = app.test_client()
     db.app = app
     db.create_all()
     db.session.query(Book).delete()
     db.session.query(Office).delete()
     db.session.commit()
Пример #2
0
from web_app import app
from web_app import db

if __name__ == '__main__':
    db.create_all()
    app.secret_key = '123456'
    app.run(debug=True, host='0.0.0.0', port=8083, threaded=True)
Пример #3
0
def create_db():
    db.create_all()
    db.session.commit()
    print(db.engine.table_names())
Пример #4
0
from web_app import db, create_app

db.create_all(app=create_app())
Пример #5
0
import sqlite3
from web_app import app
from flask import g
from flask_sqlalchemy import SQLAlchemy

from web_app import db
db.create_all()
Пример #6
0
 def setUp(self):
     db.create_all() # Setup the testing database schema
Пример #7
0
 def setUp(self):
     app = create_app('config.TestConfig')
     self.app = JWTManager(app)
     self.client = app.test_client()
     db.app = app
     db.create_all()