[Python-modules-team] Bug#755603: Fails to build with Django 1.7

Raphael Hertzog hertzog at debian.org
Thu Aug 7 20:37:45 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 \
        PYTHONPATH="." $python runtests.py; \
done
Traceback (most recent call last):
  File "runtests.py", line 58, in <module>
    main()
  File "runtests.py", line 53, in main
    failures = runtests()
  File "runtests.py", line 49, in runtests
    failures = test_runner.run_tests(INSTALLED_APPS)
  File "/usr/lib/python2.7/dist-packages/django/test/runner.py", line 146, in run_tests
    suite = self.build_suite(test_labels, extra_tests)
  File "/usr/lib/python2.7/dist-packages/django/test/simple.py", line 241, in build_suite
    app_config = apps.get_app_config(label)
  File "/usr/lib/python2.7/dist-packages/django/apps/registry.py", line 146, in get_app_config
    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