Currently, using hordak as a library requires having psycopg2 installed, but only for a few imports in some migrations that use django.contrib.postgres.fields.jsonb.JSONField. Since Django 3.2 (hordak's min supported Django ver), django.contrib.postgres.fields.jsonb.JSONField has been effectively an alias to django.db.models.JSONField (see here), so I believe it's safe to change these migrated fields to the non-postgres-specific django.db.models.JSONField.
I ran the tests on my machine locally, and all passed except two, but those two have nothing to do with the database. Might be a locale issue on my machine? I'm hoping all the tests will pass on CI.
Test results
======================================================================
ERROR: test_fees (hordak.tests.utilities.test_currency.CurrencyExchangeTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\proj\django-hordak\hordak\tests\utilities\test_currency.py", line 376, in test_fees
currency_exchange(
File "C:\proj\django-hordak\hordak\utilities\currency.py", line 197, in currency_exchange
or "Exchange of {} to {}, incurring {} fees".format(
File "C:\proj\django-hordak\venv\lib\site-packages\moneyed\classes.py", line 203, in __str__
return format_money(self)
File "C:\proj\django-hordak\venv\lib\site-packages\moneyed\l10n.py", line 23, in format_money
return babel_format_currency( # type: ignore[no-any-return]
File "C:\proj\django-hordak\venv\lib\site-packages\babel\numbers.py", line 664, in format_currency
locale = Locale.parse(locale)
File "C:\proj\django-hordak\venv\lib\site-packages\babel\core.py", line 328, in parse
raise TypeError(f"Unexpected value for identifier: {identifier!r}")
TypeError: Unexpected value for identifier: None
raise TypeError(f"Unexpected value for identifier: {identifier!r}")
TypeError: Unexpected value for identifier: None
======================================================================
ERROR: test_peter_selinger_tutorial_table_4_4 (hordak.tests.utilities.test_currency.CurrencyExchangeTestCase)
Test the example given by Peter Selinger in his muticurrency accounting tutorial. Table 4.4
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\proj\django-hordak\hordak\tests\utilities\test_currency.py", line 342, in test_peter_selinger_tutorial_table_4_4
currency_exchange(
File "C:\proj\django-hordak\hordak\utilities\currency.py", line 197, in currency_exchange
or "Exchange of {} to {}, incurring {} fees".format(
File "C:\proj\django-hordak\venv\lib\site-packages\moneyed\classes.py", line 203, in __str__
return format_money(self)
File "C:\proj\django-hordak\venv\lib\site-packages\moneyed\l10n.py", line 23, in format_money
return babel_format_currency( # type: ignore[no-any-return]
File "C:\proj\django-hordak\venv\lib\site-packages\babel\numbers.py", line 664, in format_currency
locale = Locale.parse(locale)
File "C:\proj\django-hordak\venv\lib\site-packages\babel\core.py", line 328, in parse
raise TypeError(f"Unexpected value for identifier: {identifier!r}")
TypeError: Unexpected value for identifier: None
----------------------------------------------------------------------
Ran 229 tests in 18.339s
FAILED (errors=2)
Currently, using hordak as a library requires having psycopg2 installed, but only for a few imports in some migrations that use
django.contrib.postgres.fields.jsonb.JSONField
. Since Django 3.2 (hordak's min supported Django ver),django.contrib.postgres.fields.jsonb.JSONField
has been effectively an alias todjango.db.models.JSONField
(see here), so I believe it's safe to change these migrated fields to the non-postgres-specificdjango.db.models.JSONField
.I ran the tests on my machine locally, and all passed except two, but those two have nothing to do with the database. Might be a locale issue on my machine? I'm hoping all the tests will pass on CI.
Test results