Revised the code to read from the CSV data files in the __test_base_account_data method of the ConsoleCommandTestCase test case, to prevent PyCharm from complaining.
This commit is contained in:
parent
79648a4c3b
commit
b3fa52584e
@ -81,12 +81,13 @@ class ConsoleCommandTestCase(unittest.TestCase):
|
|||||||
from accounting.models import BaseAccount
|
from accounting.models import BaseAccount
|
||||||
|
|
||||||
with open(data_dir / "base_accounts.csv") as fp:
|
with open(data_dir / "base_accounts.csv") as fp:
|
||||||
|
rows: list[dict[str, str]] = list(csv.DictReader(fp))
|
||||||
data: dict[dict[str, Any]] \
|
data: dict[dict[str, Any]] \
|
||||||
= {x["code"]: {"code": x["code"],
|
= {x["code"]: {"code": x["code"],
|
||||||
"title": x["title"],
|
"title": x["title"],
|
||||||
"l10n": {y[5:]: x[y]
|
"l10n": {y[5:]: x[y]
|
||||||
for y in x if y.startswith("l10n-")}}
|
for y in x if y.startswith("l10n-")}}
|
||||||
for x in csv.DictReader(fp)}
|
for x in rows}
|
||||||
|
|
||||||
with self.__app.app_context():
|
with self.__app.app_context():
|
||||||
accounts: list[BaseAccount] = BaseAccount.query.all()
|
accounts: list[BaseAccount] = BaseAccount.query.all()
|
||||||
|
Loading…
Reference in New Issue
Block a user