diff --git a/tests/test_description_editor.py b/tests/test_description_editor.py index 8ef8fc1..51c59e2 100644 --- a/tests/test_description_editor.py +++ b/tests/test_description_editor.py @@ -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): diff --git a/tests/test_journal_entry.py b/tests/test_journal_entry.py index 1c522ae..4ec8799 100644 --- a/tests/test_journal_entry.py +++ b/tests/test_journal_entry.py @@ -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 diff --git a/tests/test_offset.py b/tests/test_offset.py index c084aa6..de1d522 100644 --- a/tests/test_offset.py +++ b/tests/test_offset.py @@ -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 diff --git a/tests/test_option.py b/tests/test_option.py index 15fbfc5..620bac5 100644 --- a/tests/test_option.py +++ b/tests/test_option.py @@ -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" diff --git a/tests/testlib.py b/tests/testlib.py index a67d0c8..e0ef359 100644 --- a/tests/testlib.py +++ b/tests/testlib.py @@ -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. diff --git a/tests/testlib_journal_entry.py b/tests/testlib_journal_entry.py index f770a66..6a1eb2c 100644 --- a/tests/testlib_journal_entry.py +++ b/tests/testlib_journal_entry.py @@ -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. diff --git a/tests/testlib_offset.py b/tests/testlib_offset.py index 13c1f5c..c1a0508 100644 --- a/tests/testlib_offset.py +++ b/tests/testlib_offset.py @@ -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: