Example #1
0
    def test_update_equity_on_sell(self):
        create_stocks(self)
        create_buys(self, self.stock, self.user)
        create_sells(self, self.stock, self.user)

        self.assertEqual("{0:.2f}".format(self.sell1.account.equity),
                         "96167.33")
Example #2
0
 def setUpTestData(cls):
     cache.clear()
     create_test_user(cls)
     create_auth(cls, cls.user)
     create_account(cls)
     create_stocks(cls)
     create_operations(cls, cls.stock, cls.user)
 def setUpTestData(cls):
     cache.clear()
     create_test_user(cls)
     create_auth(cls, cls.user)
     create_account(cls)
     create_stocks(cls)
     create_exp_analysis(cls, cls.stock, cls.user)
Example #4
0
 def setUpTestData(cls):
     create_test_user(cls)
     create_auth(cls, cls.user)
     create_account(cls)
     create_stocks(cls)
     create_operations(cls, cls.stock, cls.user)
     create_ir_operations(cls, cls.stock2, cls.user)
     create_day_trades(cls, cls.stock2, cls.user)
Example #5
0
    def test_total_equity(self):
        create_stocks(self)
        create_buys(self, self.stock, self.user)

        accountpk = self.buy1.account.pk

        self.assertEqual(
            "{0:.2f}".format(Account.objects.get(pk=accountpk).total_equity()),
            "99956.10")
 def setUpTestData(cls):
     create_test_user(cls)
     create_auth(cls, cls.user)
     create_account(cls)
     create_stocks(cls)
Example #7
0
    def test_update_equity_on_buy(self):
        create_stocks(self)
        create_buys(self, self.stock, self.user)

        self.assertEqual("{0:.2f}".format(self.buy1.account.equity),
                         "97989.35")
 def setUpTestData(cls):
     create_test_user(cls)
     create_auth(cls, cls.user)
     account_mocks.create_account(cls)
     stock_mocks.create_stocks(cls)
     learning_mocks.create_paper_buy_sell(cls, cls.stock, cls.user)