def setUp(self): TestUnitSetUp.setUp(self) self.position_set = PositionSet.objects.get(id=65) self.date = self.position_set.filledorder_set.order_by('trade_summary__date') \ .last().trade_summary.date.strftime('%Y-%m-%d') self.profiler = Profiler(position_set=self.position_set, date=self.date)
def setUp(self): TestUnitSetUp.setUp(self) self.position_set = PositionSet.objects.get(id=65) self.date = self.position_set.filledorder_set.order_by('trade_summary__date')\ .last().trade_summary.date.strftime('%Y-%m-%d') self.profiler = ProfilerLongStock( position_set=self.position_set, date=self.date )
def setUp(self): TestUnitSetUp.setUp(self) self.filled_orders = None self.position_set = None # foreign keys self.position_instruments = list() self.profits_losses = list() self.position_forexs = list() self.position_forexs = list()
def setUp(self): TestUnitSetUp.setUp(self) self.position_set = PositionSet.objects.get(id=65) self.date = ( self.position_set.filledorder_set.order_by("trade_summary__date") .last() .trade_summary.date.strftime("%Y-%m-%d") ) self.profiler = Profiler(position_set=self.position_set, date=self.date)
def setUp(self): """ Ready up and create username for login """ TestUnitSetUp.setUp(self) User.objects.create_superuser(username='******', email='*****@*****.**', password='******') self.client = Client() self.client.login(username='******', password='******')
def setUp(self): """ Ready up and create username for login """ TestUnitSetUp.setUp(self) User.objects.create_superuser( username='******', email='*****@*****.**', password='******' ) self.client = Client() self.client.login(username='******', password='******')
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()