Files @ 281d6fed47b7
Branch filter:

Location: NPO-Accounting/experimental-accounting-api/accounting/config.py

Joar Wandborg
[test] Added unit tests

- Moved the TransactionNotFound exception to a more appropriate place.
- Changed the serialization for AccountingExceptions
- Override the Exception.__init__ method in AccountingException
- Added __eq__ methods to accounting.models.*
- Catch the TransactionNotFound exception in transaction_get and return a
404 instead. This could be improved, perhaps in the jsonify_exceptions
decorator so that all endpoints that raise a TransactionNotFound
exception automatically return a 404.
# Part of accounting-api project:
# https://gitorious.org/conservancy/accounting-api
# License: AGPLv3-or-later

import os

LEDGER_FILE = os.environ.get('LEDGER_FILE', None)
DEBUG = bool(int(os.environ.get('DEBUG', 0)))
PORT = int(os.environ.get('PORT', 5000))
HOST = os.environ.get('HOST', '127.0.0.1')
SQLALCHEMY_DATABASE_URI = os.environ.get(
    'DATABASE_URI',
    'sqlite:///../accounting-api.sqlite')