'Test the timeout method of a proposed trade request in the cache'

@blocking_call_on_reactor_thread
def test_proposed_trade_cache_timeout(self):

    ask = Ask(MessageId(TraderId('0'), MessageNumber('message_number')), OrderId(TraderId(self.market_community.mid), OrderNumber(24)), Price(63400, 'DUM1'), Quantity(30, 'DUM2'), Timeout(3600), Timestamp.now())
    order = Order(OrderId(TraderId('0'), OrderNumber(23)), Price(20, 'DUM1'), Quantity(30, 'DUM2'), Timeout(3600.0), Timestamp.now(), False)
    self.market_community.order_book.insert_ask(ask)
    self.assertEqual(len(self.market_community.order_book.asks), 1)
    self.market_community.order_manager.order_repository.add(order)
    order.reserve_quantity_for_tick(self.proposed_trade.recipient_order_id, Quantity(30, 'DUM2'))
    self.market_community.order_manager.order_repository.update(order)
    cache = ProposedTradeRequestCache(self.market_community, self.proposed_trade)
    cache.on_timeout()
    self.assertEqual(len(self.market_community.order_book.asks), 0)
