示例#1
0
    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)
示例#2
0
    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
        )
示例#3
0
    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()
示例#4
0
    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()
示例#5
0
    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)
示例#6
0
    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='******')
示例#7
0
    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='******')
示例#8
0
    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()
示例#9
0
    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()
示例#10
0
 def tearDown(self):
     """
     Remove temp username
     """
     TestUnitSetUp.tearDown(self)
     User.objects.get(username='******').delete()
示例#11
0
 def tearDown(self):
     """
     Remove temp username
     """
     TestUnitSetUp.tearDown(self)
     User.objects.get(username='******').delete()