question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tests fail with Django 1.9

See original GitHub issue
I: pybuild base:184: python2.7 setup.py test
running test
............E....EE.....................................E
======================================================================
ERROR: Failure: ImportError (cannot import name get_cache)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 420, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/«PKGBUILDDIR»/tests/../djcelery/tests/test_backends/test_cache.py", line 16, in <module>
    from djcelery.backends.cache import CacheBackend
  File "/«PKGBUILDDIR»/tests/../djcelery/backends/cache.py", line 8, in <module>
    from django.core.cache import cache, get_cache
ImportError: cannot import name get_cache

======================================================================
ERROR: test_discovery (djcelery.tests.test_discovery.TestDiscovery)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/«PKGBUILDDIR»/tests/../djcelery/tests/test_discovery.py", line 24, in test_discovery
    self.assertDiscovery()
  File "/«PKGBUILDDIR»/tests/../djcelery/tests/test_discovery.py", line 17, in assertDiscovery
    apps = autodiscover()
  File "/«PKGBUILDDIR»/tests/../djcelery/loaders.py", line 184, in autodiscover
    for app in apps.get_app_configs()])
  File "/«PKGBUILDDIR»/tests/../djcelery/loaders.py", line 209, in find_related_module
    return importlib.import_module('{0}.{1}'.format(app, related_name))
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/«PKGBUILDDIR»/tests/someapp/tasks.py", line 3, in <module>
    from django.db.models import get_model
ImportError: cannot import name get_model

======================================================================
ERROR: test_discovery_with_broken (djcelery.tests.test_discovery.TestDiscovery)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/«PKGBUILDDIR»/tests/../djcelery/tests/test_discovery.py", line 44, in test_discovery_with_broken
    autodiscover()
  File "/«PKGBUILDDIR»/tests/../djcelery/loaders.py", line 184, in autodiscover
    for app in apps.get_app_configs()])
  File "/«PKGBUILDDIR»/tests/../djcelery/loaders.py", line 209, in find_related_module
    return importlib.import_module('{0}.{1}'.format(app, related_name))
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/«PKGBUILDDIR»/tests/someapp/tasks.py", line 3, in <module>
    from django.db.models import get_model
ImportError: cannot import name get_model

======================================================================
ERROR: Failure: ImportError (cannot import name get_model)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 420, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/«PKGBUILDDIR»/tests/someapp/tests.py", line 6, in <module>
    from someapp.tasks import SomeModelTask
  File "/«PKGBUILDDIR»/tests/someapp/tasks.py", line 3, in <module>
    from django.db.models import get_model
ImportError: cannot import name get_model

----------------------------------------------------------------------
Ran 57 tests in 0.354s

FAILED (errors=4)

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
auvipycommented, Aug 23, 2016

could you guys try the master branch? will release a new version on pypi hopefully by this weekend

2reactions
azmeukcommented, Jun 20, 2016

It would be great to have this fixed and released on pypi soon. Django 1.9 is out from december (more than six months now) and projects relying on django-celery still cannot update. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

25844 (django-1.9 fails test under pypy)
Testsuite has been run with pypy tests/runtests.py --settings=test_sqlite -v2. django-1.8 works fine with same setup as cpython does.
Read more >
Tests fail for Django 1.9 · Issue #270 - GitHub
Various errors, especially "RuntimeError: Model class tests.columns.test_filecolumn.FileModel doesn't declare an explicit app_label and either isn't in an ...
Read more >
Tests fail with Django 1.9 - python-libs / passlib - GitLab
I've tracked down what changed in Django 1.9, and was able to get the tests to pass again. Outside of an import problem...
Read more >
Django 1.9 unittest error for messages but i dont see the error ...
The test fails with the error in Django 1.9 env, but tests run perfectly well in 1.10.4 and 1.8. Can someone throw some...
Read more >
Django 1.9 Mysterious Test Failure - Saul Shanabrook
This morning, I have been trying to upgrade my django-dumper library to work with Django 1.9. It started off pretty painlessly, but when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found