[Python-modules-team] Bug#755604: Fails to build with Django 1.7
Raphael Hertzog
hertzog at debian.org
Thu Aug 7 20:41:24 UTC 2014
Control: tag -1 + confirmed
The package fails to build with Django 1.7:
debian/rules override_dh_auto_test
make[1]: Entering directory '/«PKGBUILDDIR»'
set -e; \
for python in python2.7; do \
$python sitetree/runtests.py; \
done
Traceback (most recent call last):
File "sitetree/runtests.py", line 28, in <module>
main()
File "sitetree/runtests.py", line 22, in main
failures = runner.run_tests((APP_NAME,))
File "/usr/lib/python2.7/dist-packages/django/test/runner.py", line 147, in run_tests
old_config = self.setup_databases()
File "/usr/lib/python2.7/dist-packages/django/test/runner.py", line 109, in setup_databases
Creating test database for alias 'default'...
return setup_databases(self.verbosity, self.interactive, **kwargs)
File "/usr/lib/python2.7/dist-packages/django/test/runner.py", line 299, in setup_databases
serialize=connection.settings_dict.get("TEST_SERIALIZE", True),
File "/usr/lib/python2.7/dist-packages/django/db/backends/creation.py", line 374, in create_test_db
test_flush=True,
File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 93, in call_command
app_name = get_commands()[name]
File "/usr/lib/python2.7/dist-packages/django/utils/lru_cache.py", line 101, in wrapper
result = user_function(*args, **kwds)
File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 73, in get_commands
for app_config in reversed(list(apps.get_app_configs())):
File "/usr/lib/python2.7/dist-packages/django/apps/registry.py", line 137, in get_app_configs
self.check_apps_ready()
File "/usr/lib/python2.7/dist-packages/django/apps/registry.py", line 124, in check_apps_ready
raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
make[1]: *** [override_dh_auto_test] Error 1
To get past this error you need to add this to your test script:
import django
if hasattr(django, 'setup'):
django.setup()
Cheers,
--
Raphaël Hertzog ◈ Debian Developer
Discover the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/
More information about the Python-modules-team
mailing list