def setUp(self): TestCaseWithDatabase.setUp(self) self.username = '******' self.password = '******' self.email = '*****@*****.**' self.object_to_write = User(self.username, self.password, self.email) self.session = ContextManagedSession(bind=conf.DATABASE_ENGINE)
def setUpClass(cls): """ Set up the test database, and put the server into a request context requiring authentication. """ TestCaseWithDatabase.setUpClass() cls.username = '******' cls.password = '******' cls.email = '*****@*****.**'
def tearDown(self): self._clear_test_user(database_session) TestCaseWithDatabase.tearDown(self)
def setUp(self): TestCaseWithDatabase.setUp(self) self._clear_test_user(database_session) with database_session() as session: session.add(User(self.username, self.password, self.email))