Exemple #1
0
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()
Exemple #2
0
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 tearDown(self):
     db.drop_all()
 def tearDown(self):
     self.ctx.pop()
     db.session.remove()
     db.drop_all()