Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)