Closed akashdoppalapudi closed 3 months ago
It looks like you're using Python 3.11.something, right?
How are you building the django-anymail package? Anymail's standard hatchling build doesn't include the tests in the distribution, so I guess you're doing some sort of custom build?
How are you running the tests? Anymail's own runtests.py? tox? Something custom? Any relevant environment settings?
Have you modified anything in the tests or in Anymail?
How are you getting Django its settings? If you're using Anymail's runtests.py or tox, it will provide appropriate settings (if you've included tests/test_settings in your distribution) and will identify the module it's using at the start of the test output. If you're using your own test runner, what settings are you using, and how are you telling Django where to find them? (Did you include "anymail" in the INSTALLED_APPS?)
What other Python packages are installed? Have you installed the packages specified by tests/requirements.txt? (That wouldn't cause these errors, but it will cause others.)
If none of that helps, I'd suggest carefully comparing your test environment with a successful runs to see what differs. Anymail was tested against Django 4.2.13 and Python 3.11.9 a few days ago in a weekly scheduled run, without error. Expand the "Test django42-py311-all" node in the logs panel to see the details of installed packages, commands, settings module, etc. (This ran against the current main branch, but I'd expect 10.3 to behave the same, with possibly a single error depending on your exact Python version. Nothing like what you're seeing.)
Finally, you might try searching the web for "AppRegistryNotReady." (I have a vague memory that error can be caused by trying to call Django functions directly from your settings module, or something along those lines, but could be misremembering.)
Thanks, I was running tests using pytest runner and I set django settings using an env variable.
Now I'm using runtests.py and it fixes my issue.
@akashdoppalapudi glad that solved it.
Incidentally, it looks like the Debian dist is still suggesting the python-sparkpost package. That's no longer necessary. django-anymail dropped all use of python-sparkpost in v8.0 on 2020-09-11. (python-sparkpost didn't appear to be maintained.)
Thanks for letting me know, I'll fix it.
I'm trying to package anymail 10.3 for Debian.
I'm using django version 4.2.13 with anymail.
When I run tests they fail with error "django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet."
Many of the tests fail with different stack traces but end up on this error.
I'll give two of those stack traces
The next stack trace contains the above error but ends at translation related error
Most of the tests fail with these kind of stack traces.
Can you help me out with this.