Example #1
0
    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)
Example #2
0
    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)
Example #3
0
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'
    )
Example #4
0
    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'])
Example #5
0
    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'])
Example #6
0
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')