Skip to content

TEST FAILED: python manage.py test tests/ --noinput #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Calsiferian opened this issue Mar 26, 2025 · 3 comments
Open

TEST FAILED: python manage.py test tests/ --noinput #181

Calsiferian opened this issue Mar 26, 2025 · 3 comments
Labels
good first issue Good for newcomers

Comments

@Calsiferian
Copy link

ERROR: test_currency_rate_backend (tests.crm.backends.test_currency_rate_backend.TestCurrencyRateBackend)

Traceback (most recent call last):
File "/home/daniel/CRMAndromeda/CRMvenv/lib/python3.10/site-packages/requests/models.py", line 974, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/daniel/CRMAndromeda/CRMAndromeda/tests/crm/backends/test_currency_rate_backend.py", line 20, in test_currency_rate_backend
backend = be(state_currency, MARKETING_CURRENCY, today)
File "/home/daniel/CRMAndromeda/CRMAndromeda/crm/backends/bank_gov_ua_backend.py", line 26, in init
self.data = self.get_data(marketing_currency)
File "/home/daniel/CRMAndromeda/CRMAndromeda/crm/backends/bank_gov_ua_backend.py", line 33, in get_data
return response.json()
File "/home/daniel/CRMAndromeda/CRMvenv/lib/python3.10/site-packages/requests/models.py", line 978, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@DjangoCRM
Copy link
Owner

Thanks for the report.
Is this a stable error?
I can't get it.

@Calsiferian
Copy link
Author

If it is an error that occurs when I run python manage.py test tests/ --noinput
django 5.1.5
Python 3.10.12
mysql Ver 8.0.41
22.04.1-Ubuntu

@DjangoCRM
Copy link
Owner

It seems the problem was that the response from the currency quotes service was not in json format as expected.
It will be enough to add exception handling for this error and save it in self.error.

@DjangoCRM DjangoCRM added the good first issue Good for newcomers label Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants