'Test whether the API returns the right payments when we perform a request'

@deferred(timeout=10)
def test_get_payments(self):

    def on_response(response):
        json_response = json.loads(response)
        self.assertIn('payments', json_response)
        self.assertEqual(len(json_response['payments']), 1)
    transaction = self.add_transaction_and_payment()
    self.should_check_equality = False
    return self.do_request(('market/transactions/%s/%s/payments' % (transaction.transaction_id.trader_id, transaction.transaction_id.transaction_number)), expected_code=200).addCallback(on_response)
