Moved the Accounts shortcut from testlib_journal_entry.py to testlib.py.
This commit is contained in:
parent
361b18e411
commit
7515032082
@ -24,8 +24,8 @@ from click.testing import Result
|
||||
from flask import Flask
|
||||
from flask.testing import FlaskCliRunner
|
||||
|
||||
from testlib import NEXT_URI, create_test_app, get_client
|
||||
from testlib_journal_entry import Accounts, add_journal_entry
|
||||
from testlib import NEXT_URI, Accounts, create_test_app, get_client
|
||||
from testlib_journal_entry import add_journal_entry
|
||||
|
||||
|
||||
class DescriptionEditorTestCase(unittest.TestCase):
|
||||
|
@ -27,9 +27,9 @@ from flask import Flask
|
||||
from flask.testing import FlaskCliRunner
|
||||
|
||||
from test_site import db
|
||||
from testlib import NEXT_URI, create_test_app, get_client
|
||||
from testlib import NEXT_URI, Accounts, create_test_app, get_client
|
||||
from testlib_journal_entry import NON_EMPTY_NOTE, EMPTY_NOTE, \
|
||||
Accounts, get_add_form, get_unchanged_update_form, get_update_form, \
|
||||
get_add_form, get_unchanged_update_form, get_update_form, \
|
||||
match_journal_entry_detail, set_negative_amount, \
|
||||
remove_debit_in_a_currency, remove_credit_in_a_currency, add_journal_entry
|
||||
|
||||
|
@ -26,8 +26,8 @@ from flask import Flask
|
||||
from flask.testing import FlaskCliRunner
|
||||
|
||||
from test_site import db
|
||||
from testlib import create_test_app, get_client
|
||||
from testlib_journal_entry import Accounts, match_journal_entry_detail
|
||||
from testlib import Accounts, create_test_app, get_client
|
||||
from testlib_journal_entry import match_journal_entry_detail
|
||||
from testlib_offset import TestData, JournalEntryLineItemData, \
|
||||
JournalEntryData, CurrencyData
|
||||
|
||||
|
@ -26,8 +26,7 @@ from flask import Flask
|
||||
from flask.testing import FlaskCliRunner
|
||||
|
||||
from test_site import db
|
||||
from testlib import NEXT_URI, create_test_app, get_client
|
||||
from testlib_journal_entry import Accounts
|
||||
from testlib import NEXT_URI, Accounts, create_test_app, get_client
|
||||
from testlib_offset import TestData
|
||||
|
||||
PREFIX: str = "/accounting/options"
|
||||
|
@ -30,6 +30,31 @@ NEXT_URI: str = "/_next"
|
||||
"""The next URI."""
|
||||
|
||||
|
||||
class Accounts:
|
||||
"""The shortcuts to the common accounts."""
|
||||
CASH: str = "1111-001"
|
||||
PETTY_CASH: str = "1112-001"
|
||||
BANK: str = "1113-001"
|
||||
NOTES_RECEIVABLE: str = "1131-001"
|
||||
RECEIVABLE: str = "1141-001"
|
||||
PREPAID: str = "1258-001"
|
||||
NOTES_PAYABLE: str = "2131-001"
|
||||
PAYABLE: str = "2141-001"
|
||||
SALES: str = "4111-001"
|
||||
SERVICE: str = "4611-001"
|
||||
AGENCY: str = "4711-001"
|
||||
RENT_EXPENSE: str = "6252-001"
|
||||
OFFICE: str = "6253-001"
|
||||
TRAVEL: str = "6254-001"
|
||||
POSTAGE: str = "6256-001"
|
||||
UTILITIES: str = "6261-001"
|
||||
INSURANCE: str = "6262-001"
|
||||
MEAL: str = "6272-001"
|
||||
INTEREST: str = "7111-001"
|
||||
DONATION: str = "7481-001"
|
||||
RENT_INCOME: str = "7482-001"
|
||||
|
||||
|
||||
def create_test_app() -> Flask:
|
||||
"""Creates and returns the testing Flask application.
|
||||
|
||||
|
@ -26,7 +26,7 @@ import httpx
|
||||
from flask import Flask
|
||||
|
||||
from test_site import db
|
||||
from testlib import NEXT_URI
|
||||
from testlib import NEXT_URI, Accounts
|
||||
|
||||
NON_EMPTY_NOTE: str = " This is \n\na test."
|
||||
"""The stripped content of an non-empty note."""
|
||||
@ -34,31 +34,6 @@ EMPTY_NOTE: str = " \n\n "
|
||||
"""The empty note content."""
|
||||
|
||||
|
||||
class Accounts:
|
||||
"""The shortcuts to the common accounts."""
|
||||
CASH: str = "1111-001"
|
||||
PETTY_CASH: str = "1112-001"
|
||||
BANK: str = "1113-001"
|
||||
NOTES_RECEIVABLE: str = "1131-001"
|
||||
RECEIVABLE: str = "1141-001"
|
||||
PREPAID: str = "1258-001"
|
||||
NOTES_PAYABLE: str = "2131-001"
|
||||
PAYABLE: str = "2141-001"
|
||||
SALES: str = "4111-001"
|
||||
SERVICE: str = "4611-001"
|
||||
AGENCY: str = "4711-001"
|
||||
RENT_EXPENSE: str = "6252-001"
|
||||
OFFICE: str = "6253-001"
|
||||
TRAVEL: str = "6254-001"
|
||||
POSTAGE: str = "6256-001"
|
||||
UTILITIES: str = "6261-001"
|
||||
INSURANCE: str = "6262-001"
|
||||
MEAL: str = "6272-001"
|
||||
INTEREST: str = "7111-001"
|
||||
DONATION: str = "7481-001"
|
||||
RENT_INCOME: str = "7482-001"
|
||||
|
||||
|
||||
def get_add_form(csrf_token: str) -> dict[str, str]:
|
||||
"""Returns the form data to add a new journal entry.
|
||||
|
||||
|
@ -26,8 +26,8 @@ import httpx
|
||||
from flask import Flask
|
||||
|
||||
from test_site import db
|
||||
from testlib import NEXT_URI
|
||||
from testlib_journal_entry import Accounts, match_journal_entry_detail
|
||||
from testlib import NEXT_URI, Accounts
|
||||
from testlib_journal_entry import match_journal_entry_detail
|
||||
|
||||
|
||||
class JournalEntryLineItemData:
|
||||
|
Loading…
Reference in New Issue
Block a user