How to use the futures.models.Future function in futures

To help you get started, we’ve selected a few futures examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github domino14 / Webolith / djAerolith / futures / tests.py View on Github external
def test_simultaneous_sell_short(self):
        """
            Can't short-sell and regular sell the same shares simultaneously.
        """
        user = User.objects.get(pk=1)
        wallet = Wallet.objects.get(user=user)
        wallet.shares_owned = """{"1": 3}"""
        future = Future.objects.get(pk=1)
        response = process_order(4, 200, wallet, 'sell', future)
        # We only own 3 but are trying to sell 4.
        self.assertContains(response, 'two separate orders', status_code=400)