def setUp(self):
self.user_name = 'demo'
self.app = create_app()
self.app.app_context().push()
with self.app.test_request_context():
db.drop_all()
db.create_all()
user = User(id=11,
name=self.user_name,
secret='supersecret')
publisher = Publisher(name='test_pub_id')
association = PublisherUser(role=UserRoleEnum.owner)
association.publisher = publisher
user.publishers.append(association)
db.session.add(user)
db.session.commit()
评论列表
文章目录