Moved the duplicated NEXT_URI constant from test_account.py and testlib_journal_entry.py to testlib.py.

This commit is contained in:
依瑪貓 2023-03-23 17:22:57 +08:00
parent 7d084e570e
commit 361b18e411
8 changed files with 14 additions and 16 deletions

View File

@ -27,12 +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 create_test_app, get_client, set_locale from testlib import NEXT_URI, create_test_app, get_client, set_locale
from testlib_journal_entry import add_journal_entry from testlib_journal_entry import add_journal_entry
NEXT_URI: str = "/_next"
"""The next URI."""
class AccountData: class AccountData:
"""The account data.""" """The account data."""

View File

@ -28,8 +28,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, set_locale from testlib import NEXT_URI, create_test_app, get_client, set_locale
from testlib_journal_entry import add_journal_entry, NEXT_URI from testlib_journal_entry import add_journal_entry
class CurrencyData: class CurrencyData:

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 create_test_app, get_client from testlib import NEXT_URI, create_test_app, get_client
from testlib_journal_entry import Accounts, NEXT_URI, add_journal_entry from testlib_journal_entry import Accounts, add_journal_entry
class DescriptionEditorTestCase(unittest.TestCase): class DescriptionEditorTestCase(unittest.TestCase):

View File

@ -27,8 +27,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 NEXT_URI, create_test_app, get_client
from testlib_journal_entry import NEXT_URI, 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, \ Accounts, 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 NEXT_URI, create_test_app, get_client
from testlib_journal_entry import NEXT_URI, Accounts 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

@ -26,6 +26,8 @@ from test_site import create_app
TEST_SERVER: str = "https://testserver" TEST_SERVER: str = "https://testserver"
"""The test server URI.""" """The test server URI."""
NEXT_URI: str = "/_next"
"""The next URI."""
def create_test_app() -> Flask: def create_test_app() -> Flask:

View File

@ -26,9 +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
NEXT_URI: str = "/_next"
"""The next URI."""
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."""
EMPTY_NOTE: str = " \n\n " EMPTY_NOTE: str = " \n\n "

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_journal_entry import Accounts, match_journal_entry_detail, \ from testlib import NEXT_URI
NEXT_URI from testlib_journal_entry import Accounts, match_journal_entry_detail
class JournalEntryLineItemData: class JournalEntryLineItemData: