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