def tearDown(self): """This cleans up after test case. It removes SQLAlchemy database session and drops all tables. This function executes after every single test. """ db.session.remove() db.drop_all()
def setUp(self): db.drop_all() db.create_all() self.app = app.test_client() self.context = app.test_request_context() self.email = '*****@*****.**' self.author = 'WilliamsCarlosWilliams' self.password = '******' self.spring = 'Spring and All' self.imaginations = '''\tThe imagination, intoxicated by prohibitions, rises to drunken heights to destroy the world. Let it rage, let it kill. The imagination is supreme.''' AUTHOR = Author(self.email, self.author, self.password) db.session.add(AUTHOR) db.session.commit() self.context.push()
def tearDown(self): db.session.remove() db.drop_all()
def tearDown(self): db.session.remove() db.drop_all() os.close(self.db_fd) os.unlink(app.config['DATABASE'])
def tearDown(self): db.session.remove() db.drop_all() self.app_context.pop()
def tearDown(self): db.drop_all()
def tearDown(self): db.session.remove() db.drop_all() self.context.pop()