def tearDown(self): """ Clean up database... """ TestUnitSetUp.tearDown(self) if self.position_set is not None: self.position_set = self.position_set """:type: PositionSet""" self.position_set.filledorder_set.update(position_set=None) self.position_set.positioninstrument_set.update(position_set=None) self.position_set.positionfuture_set.update(position_set=None) self.position_set.positionforex_set.update(position_set=None) self.position_set.profitloss_set.update(position_set=None) if self.position_set.id: self.position_set.delete()
def tearDown(self): """ Remove temp username """ TestUnitSetUp.tearDown(self) User.objects.get(username='******').delete()