def testRevertingDocuments(self): old = dbtools.get_current_initials() dbtools.initial_data(SomeDocument) current = dbtools.get_current_initials() self.assertEqual(len(old) + 1, len(current)) dbtools.reset_documents(old) current = dbtools.get_current_initials() self.assertEqual(len(old), len(current))
def tearDown(self): yield SimulationTest.tearDown(self) current = dbtools.get_current_initials() self.assertFalse(isinstance(current[-1], SomeDocument))
def __init__(self, *args, **kwargs): common.TestCase.__init__(self, *args, **kwargs) initial_documents = dbtools.get_current_initials() self.addCleanup(dbtools.reset_documents, initial_documents) self.overriden_configs = None