def tearDownClass(cls): from database import db, drop_all, remove_session drop_all() remove_session() db.engine.execute('DELETE FROM ...') # Maybe some default datas ?
def remove_session(sessionid: str, secret: str): """ log out of a single session """ try: uuid.UUID(sessionid) except ValueError as e: raise SantaErrors.SessionError("Session ids must be a uuid format") results = database.remove_session(sessionid, secret) if len(results) == 0: raise SantaErrors.SessionError( "Session id or verify code was not found.") if isinstance(results, list): results = results[0] return { 'session': results['id'], }
def tearDown(self): from database import drop_all, remove_session drop_all() remove_session()
def tearDown(self): from database import drop_all, remove_session drop_all() remove_session()
def tearDownClass(cls): from database import db, drop_all, remove_session drop_all() remove_session()
def teardown_request(exception): database.remove_session()