Moved the Accounts shortcut from testlib_journal_entry.py to testlib.py.

This commit is contained in:
依瑪貓 2023-03-23 17:26:27 +08:00
parent 361b18e411
commit 7515032082
7 changed files with 35 additions and 36 deletions

View File

@ -24,8 +24,8 @@ from click.testing import Result
from flask import Flask from flask import Flask
from flask.testing import FlaskCliRunner from flask.testing import FlaskCliRunner
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 Accounts, add_journal_entry from testlib_journal_entry import add_journal_entry
class DescriptionEditorTestCase(unittest.TestCase): class DescriptionEditorTestCase(unittest.TestCase):

View File

@ -27,9 +27,9 @@ from flask import Flask
from flask.testing import FlaskCliRunner from flask.testing import FlaskCliRunner
from test_site import db 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, \ 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, \ match_journal_entry_detail, set_negative_amount, \
remove_debit_in_a_currency, remove_credit_in_a_currency, add_journal_entry remove_debit_in_a_currency, remove_credit_in_a_currency, add_journal_entry

View File

@ -26,8 +26,8 @@ from flask import Flask
from flask.testing import FlaskCliRunner from flask.testing import FlaskCliRunner
from test_site import db from test_site import db
from testlib import create_test_app, get_client from testlib import Accounts, create_test_app, get_client
from testlib_journal_entry import Accounts, match_journal_entry_detail from testlib_journal_entry import match_journal_entry_detail
from testlib_offset import TestData, JournalEntryLineItemData, \ from testlib_offset import TestData, JournalEntryLineItemData, \
JournalEntryData, CurrencyData JournalEntryData, CurrencyData

View File

@ -26,8 +26,7 @@ from flask import Flask
from flask.testing import FlaskCliRunner from flask.testing import FlaskCliRunner
from test_site import db 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 Accounts
from testlib_offset import TestData from testlib_offset import TestData
PREFIX: str = "/accounting/options" PREFIX: str = "/accounting/options"

View File

@ -30,6 +30,31 @@ NEXT_URI: str = "/_next"
"""The next URI.""" """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: def create_test_app() -> Flask:
"""Creates and returns the testing Flask application. """Creates and returns the testing Flask application.

View File

@ -26,7 +26,7 @@ import httpx
from flask import Flask from flask import Flask
from test_site import db 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." NON_EMPTY_NOTE: str = " This is \n\na test."
"""The stripped content of an non-empty note.""" """The stripped content of an non-empty note."""
@ -34,31 +34,6 @@ EMPTY_NOTE: str = " \n\n "
"""The empty note content.""" """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]: def get_add_form(csrf_token: str) -> dict[str, str]:
"""Returns the form data to add a new journal entry. """Returns the form data to add a new journal entry.

View File

@ -26,8 +26,8 @@ import httpx
from flask import Flask from flask import Flask
from test_site import db from test_site import db
from testlib import NEXT_URI from testlib import NEXT_URI, Accounts
from testlib_journal_entry import Accounts, match_journal_entry_detail from testlib_journal_entry import match_journal_entry_detail
class JournalEntryLineItemData: class JournalEntryLineItemData: