'Test whether a decline trade is sent between nodes if the price of a proposed trade is not right'

@blocking_call_on_reactor_thread
@inlineCallbacks
def test_decline_trade(self):

    (yield self.introduce_nodes(self.node_a, self.node_b))
    (yield self.create_send_ask(self.node_a, self.node_b))
    self.node_b.community.create_bid(9, 'DUM1', 10, 'DUM2', 3600)
    (yield self.parse_assert_packets(self.node_a))
    order_a = self.node_a.community.order_manager.order_repository.find_all()[0]
    order_b = self.node_b.community.order_manager.order_repository.find_all()[0]
    order_b.reserve_quantity_for_tick(order_a.order_id, order_b.total_quantity)
    self.node_b.community.order_manager.order_repository.update(order_b)
    proposed_trade = Trade.propose(self.node_b.community.order_book.message_repository.next_identity(), order_b.order_id, order_a.order_id, Price(9, 'DUM1'), order_b.total_quantity, Timestamp.now())
    self.node_b.community.send_proposed_trade(proposed_trade)
    deferred = Deferred()
    def mocked_remove(_):
        deferred.callback(None)
    self.node_b.community.order_book.remove_tick = mocked_remove
    (yield self.parse_assert_packets(self.node_a))
    (yield self.parse_assert_packets(self.node_b))
    (yield deferred)
