django1/tests/admin_scripts
Aymeric Augustin a4cb140004 Added get_app_config() to look up app configs by label.
Refactored get_app() to rely on that method.

get_app() starts by calling _populate(), which goes through
INSTALLED_APPS and, for each app, imports the app module and attempts to
import the models module. At this point, no further imports are
necessary to return the models module for a  given app. Therefore, the
implementation of get_app() can be simplified and the safeguards for
race conditions can be removed.

Besides, the emptyOK parameter isn't used anywhere in Django. It was
introduced in d6c95e93 but not actually used nor documented, and it has
just been carried around since then. Since it's an obscure private API,
it's acceptable to stop supporting it without a deprecation path. This
branch aims at providing first-class support for applications without a
models module eventually.

For backwards-compatibility, get_app() still raises ImproperlyConfigured
when an app isn't found, even though LookupError is technically more
correct. I haven't gone as far as to preserve the exact error messages.
I've adjusted a few tests instead.
2013-12-17 10:17:44 +01:00
..
app_with_import Advanced deprecation warnings for Django 1.7. 2013-06-29 18:49:37 +02:00
broken_app Fixed #21302 -- Fixed unused imports and import *. 2013-11-02 15:24:56 -04:00
complex_app Fixed #21302 -- Fixed unused imports and import *. 2013-11-02 15:24:56 -04:00
custom_templates Whitespace cleanup. 2013-10-10 16:49:20 -04:00
management Fix all violators of E231 2013-10-26 12:15:03 -07:00
simple_app Fixed #21302 -- Fixed unused imports and import *. 2013-11-02 15:24:56 -04:00
__init__.py Merged regressiontests and modeltests into the test root. 2013-02-26 14:36:57 +01:00
models.py Merged regressiontests and modeltests into the test root. 2013-02-26 14:36:57 +01:00
tests.py Added get_app_config() to look up app configs by label. 2013-12-17 10:17:44 +01:00
urls.py Merged regressiontests and modeltests into the test root. 2013-02-26 14:36:57 +01:00