def setUp(self): self.app = create_app('TESTING') self.ctx = self.app.app_context() self.ctx.push() self.client = self.app.test_client() db.create_all() self.init_data()
def initdb(): db.drop_all() db.create_all() admin = User( first_name='Alex', last_name='Frazer', email='*****@*****.**', role_code=ADMIN, username='******', password='******' ) db.session.add(admin) db.session.commit()
def initdemo(): db.drop_all() db.create_all() admin = User( first_name='Alex', last_name='Frazer', email='*****@*****.**', role_code=ADMIN, username='******', password='******' ) db.session.add(admin) db.session.commit() User.add_fake_users() NewsArticle.populate_news()
def setUp(self): db.create_all() self.init_data()