def setUp(self): self.app = create_app('testing') self.ctx = self.app.app_context() self.ctx.push() db.drop_all() db.create_all() u = User(username=self.default_username) u.set_password(self.default_password) db.session.add(u) db.session.commit() self.client = TestClient(self.app, u.generate_auth_token(), '') # u.generate_auth_token()
def tearDown(self): db.session.remove() db.drop_all() self.ctx.pop()