﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21715	Cannot run tests with the new changes on @master anymore	Matthias Kestenholz	nobody	"I tried running the of Towel (https://github.com/matthiask/towel/) with Django@master this morning. It does not really matter which project I'm taking though, none of them work right now.

For reference, the initial traceback:
{{{
mk@mbp:~/Projects/towel/tests$ .tox/py32-django17/bin/python manage.py runserver
Traceback (most recent call last):
  File ""manage.py"", line 13, in <module>
    execute_from_command_line(sys.argv)
  File ""/Users/mk/Projects/towel/tests/.tox/py32-django17/src/django/django/core/management/__init__.py"", line 427, in execute_from_command_line
    utility.execute()
  File ""/Users/mk/Projects/towel/tests/.tox/py32-django17/src/django/django/core/management/__init__.py"", line 419, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File ""/Users/mk/Projects/towel/tests/.tox/py32-django17/src/django/django/core/management/__init__.py"", line 287, in fetch_command
    commands = get_commands()
  File ""/Users/mk/Projects/towel/tests/.tox/py32-django17/src/django/django/core/management/__init__.py"", line 124, in get_commands
    apps.populate(installed_apps)
  File ""/Users/mk/Projects/towel/tests/.tox/py32-django17/src/django/django/apps/registry.py"", line 87, in populate
    app_config.import_models(all_models)
  File ""/Users/mk/Projects/towel/tests/.tox/py32-django17/src/django/django/apps/base.py"", line 160, in import_models
    self.models_module = import_module(models_module_name)
  File ""/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/importlib/__init__.py"", line 124, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File ""/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/importlib/_bootstrap.py"", line 821, in _gcd_import
    loader.load_module(name)
  File ""/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/importlib/_bootstrap.py"", line 436, in load_module
    return self._load_module(fullname)
  File ""/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/importlib/_bootstrap.py"", line 141, in decorated
    return fxn(self, module, *args, **kwargs)
  File ""/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/importlib/_bootstrap.py"", line 342, in _load_module
    exec(code_object, module.__dict__)
  File ""/Users/mk/Projects/towel/tests/testapp/models.py"", line 9, in <module>
    from towel.modelview import ModelViewURLs
  File ""/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/importlib/_bootstrap.py"", line 436, in load_module
    return self._load_module(fullname)
  File ""/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/importlib/_bootstrap.py"", line 141, in decorated
    return fxn(self, module, *args, **kwargs)
  File ""/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/importlib/_bootstrap.py"", line 342, in _load_module
    exec(code_object, module.__dict__)
  File ""/Users/mk/Projects/towel/towel/modelview.py"", line 24, in <module>
    class ModelView(object):
  File ""/Users/mk/Projects/towel/towel/modelview.py"", line 98, in ModelView
    _('The new object has been successfully created.')),
  File ""/Users/mk/Projects/towel/tests/.tox/py32-django17/src/django/django/utils/translation/__init__.py"", line 80, in ugettext
    return _trans.ugettext(message)
  File ""/Users/mk/Projects/towel/tests/.tox/py32-django17/src/django/django/utils/translation/trans_real.py"", line 310, in gettext
    return do_translate(message, 'gettext')
  File ""/Users/mk/Projects/towel/tests/.tox/py32-django17/src/django/django/utils/translation/trans_real.py"", line 297, in do_translate
    _default = translation(settings.LANGUAGE_CODE)
  File ""/Users/mk/Projects/towel/tests/.tox/py32-django17/src/django/django/utils/translation/trans_real.py"", line 199, in translation
    default_translation = _fetch(settings.LANGUAGE_CODE)
  File ""/Users/mk/Projects/towel/tests/.tox/py32-django17/src/django/django/utils/translation/trans_real.py"", line 182, in _fetch
    for app_config in reversed(list(apps.get_app_configs())):
  File ""/Users/mk/Projects/towel/tests/.tox/py32-django17/src/django/django/apps/registry.py"", line 108, in get_app_configs
    self.check_ready()
  File ""/Users/mk/Projects/towel/tests/.tox/py32-django17/src/django/django/apps/registry.py"", line 101, in check_ready
    ""App registry isn't populated yet. ""
RuntimeError: App registry isn't populated yet. Have you called django.setup()?
}}}

I could not get it running after several attempts of adding `django.setup()` to various places in `manage.py` and `django/core/management/base.py`

The code always hits `populate()`, `ugettext()`, `get_app_configs()`, `check_ready`, only the first few lines of the traceback are different."	Bug	closed	Core (Other)	dev	Normal	fixed			Unreviewed	0	0	0	0	0	0
