def init_db(): db.create_all() password = pwd_context.encrypt('111111') u = User(username='******', email='*****@*****.**', password_hash=password) p = Post(title='First post', slug='first-post', body="Welcome to my blog. I will be putting up posts about various topics, so make sure to check back soon.", author=u) db.session.add(u) db.session.add(p) db.session.commit() print 'Initialized the db'
def init_db(): db.create_all() password = pwd_context.encrypt('111111') u = User(username='******', email='*****@*****.**', password_hash=password) p = Post( title='First post', slug='first-post', body= "Welcome to my blog. I will be putting up posts about various topics, so make sure to check back soon.", author=u) db.session.add(u) db.session.add(p) db.session.commit() print 'Initialized the db'
def create_db(): db.create_all()
def setUp(self): angular_flask.app.config.from_object('angular_flask.settings.TestingConfig') self.db_fd, angular_flask.app.config['DATABASE'] = tempfile.mkstemp() self.app = angular_flask.app.test_client() db.create_all()