'Test aborting a transaction'

@blocking_call_on_reactor_thread
def test_abort_transaction(self):

    self.order.reserve_quantity_for_tick(OrderId(TraderId('0'), OrderNumber(23)), Quantity(30, 'DUM2'))
    self.market_community.order_manager.order_repository.add(self.order)
    self.market_community.update_ip(TraderId('0'), ('127.0.0.1', 1234))
    self.market_community.start_transaction(self.proposed_trade)
    transaction = self.market_community.transaction_manager.find_all()[0]
    self.assertTrue(transaction)
    self.assertEqual(self.order.reserved_quantity, Quantity(30, 'DUM2'))
    self.market_community.abort_transaction(transaction)
    order = self.market_community.order_manager.order_repository.find_by_id(transaction.order_id)
    self.assertEqual(order.reserved_quantity, Quantity(0, 'DUM2'))
