'Test that we get correct amounts and totals back on POSTs to payment-instruction.json'

def test_api_returns_amount_and_totals(self):

    self.make_team(u'A', is_approved=True)
    self.make_team(u'B', is_approved=True)
    self.make_participant(u'alice', claimed_time=u'now', last_bill_result=u'')
    response1 = self.client.POST(u'/A/payment-instruction.json', {u'amount': u'1.50'}, auth_as=u'alice')
    response2 = self.client.POST(u'/B/payment-instruction.json', {u'amount': u'3.00'}, auth_as=u'alice')
    first_data = json.loads(response1.body)
    second_data = json.loads(response2.body)
    assert (first_data[u'amount'] == u'1.50')
    assert (second_data[u'amount'] == u'3.00')
    assert (first_data[u'total_giving'] == u'1.50')
    assert (second_data[u'total_giving'] == u'4.50')
