def test_get_all_transaction_amounts(self): """Verify the first dict has the right keys.""" results = fec.get_all_transaction_amounts() result = results[0] # Inspect first result for proper keys self.assertIn('state', result) self.assertIn('amount', result)
def all_transaction_amounts(): """Return a JSON response containing all the postitive contributions.""" return Response( ujson.dumps({'txn_amounts': get_all_transaction_amounts()}), mimetype='application/json' )
def test_get_all_transaction_amounts_all_positive(self): """Verify all records returned are greater than 0.""" results = fec.get_all_transaction_amounts() for result in results: self.assertLess(0, result['amount'])
def all_transaction_amounts(): """Return a JSON response containing all the postitive contributions.""" return Response(ujson.dumps({'txn_amounts': get_all_transaction_amounts()}), mimetype='application/json')