Search code examples
pythondjangodjango-nose

Django-nose failure - KeyError: u'en-us'


I have all of my TestCase files in a django app called 'tests'. Running a specific TestCase works just fine with this command:

python run manage.py test tests.myTestCaseFile

However, when i run the entire set of TestCases in the tests folder this fails:

python run manage.py test tests

In this case many ImportErrors are triggered as well as KeyError: 'en-us'. Essentially every single TestMethod errors out in one way or another.

Any ideas what could be happening here?

NOTE: I have already tried to import myapp.urls in the shell and reverse(urlname) works just fine there..


Solution

  • I've solved this issue:

    • KeyError: u'en-us' seems to occur anytime there is an import error in any test module

    I had a test file which was testing functionality that did not exist in the current branch.

    Seems that an import error in any test file prevents execution of the entire test suite.