Exemplo n.º 1
0
    def setUp(self):
        build_user()
        build_positions()

        mike = User(**{
             "username": "******",
             "realname": "Mike Bloom",
             "balance": 10000.0
        })
        mike.hash_password("password")
        mike.save()

        appl = Position(**{
            "ticker" : "AAPL",
            "amount": 5,
            "user_info_pk": mike.pk
        })

        tsla = Position(**{
            "ticker" : "TSLA",
            "amount": 10,
            "user_info_pk": mike.pk
        })

        appl.save()
        tsla.save()
Exemplo n.º 2
0
    def setUp(self):
        build_user()
        build_positions()
        build_trades()

        mike = User(**{
            "username": "******",
            "realname": "Mike Bloom",
            "balance": 10000.0
        })
        mike.hash_password("password")
        mike.generate_api_key()
        mike.save()
Exemplo n.º 3
0
    def setUp(self):
        build_user()
        build_positions()
        build_trades()

        mike = User(
            **{
                "username": "******",
                "realname": "Mike Bloom",
                "balance": 10000000.0
            })
        mike.hash_password("password")
        mike.save()

        mike.buy("stok", 2)
        mike.sell("stok", 1)
Exemplo n.º 4
0
    def setUp(self):
        app.config['TESTING'] = True
        app.config['DEBUG'] = False
        self.app = app.test_client()
    
        build_user()
        build_positions()
        build_trades()

        mike = User(**{
        "user_name": "mikebloom",
        "password": "******",
        "real_name": "Mike Bloom",
        "balance": 0.0
        })
        mike.hash_password("password")
        mike.api_key = "11111111111111111111"
        mike.save()

        return app