def forge(category, post, comment): """Generates the fake categories, posts, and comments.""" from bluelog.fakes import fake_categories, fake_post, fake_comments, fake_admim db.drop_all() db.create_all() click.echo('Generating the administrator...') fake_admim() click.echo('Generating %d categories...' % category) fake_categories() click.echo('Generating %d posts...' % post) fake_post() click.echo('Generating %d comments...' % comment) fake_comments() click.echo('Done.')
def tearDown(self): db.session.remove() db.drop_all()
def tearDown(self): db.drop_all() # 测试结束,销毁应用上下文对象 self.context.pop()
def tearDown(self): db.session.remove() db.drop_all() self.app_context.pop()