def setUp(self): self.app = create_app('testing') self.app_context = self.app.app_context() self.app_context.push() db.create_all() Role.insert_roles() self.client = self.app.test_client(use_cookies=True)
def deploy(): """Run deployment tasks.""" from flask.ext.migrate import upgrade from wtxlog.models import Role, User upgrade() #db.create_all() # create user roles Role.insert_roles()
def deploy(): """Run deployment tasks.""" from flask.ext.migrate import upgrade from wtxlog.models import Role upgrade() # db.create_all() # create user roles Role.insert_roles()
def setUp(self): self.app = create_app('testing') self.app_context = self.app.app_context() self.app_context.push() db.create_all() Role.insert_roles()
# -*- coding: utf-8 -*- """ Just for development time """ from manage import db from wtxlog.models import User, Role, Category if __name__ == '__main__': # init database db.create_all() # create user roles Role.insert_roles() # add administrator user = User() user.username = '******' user.password = '******' user.email = '*****@*****.**' user.role = Role.query.filter_by(permissions=0xff).first() user.confirmed = True # add default category category = Category() category.slug = 'default' category.name = 'Default' # commit db.session.add(user)