Removed the app_config.installed flag.

Since applications that aren't installed no longer have an application
configuration, it is now always True in practice.

Provided an abstraction to temporarily add or remove applications as
several tests messed with app_config.installed to achieve this effect.
For now this API is _-prefixed because it looks dangerous.
This commit is contained in:
Aymeric Augustin 2013-12-18 13:16:33 +01:00
parent 972babc3b4
commit 9b3389b726
10 changed files with 99 additions and 60 deletions

View file

@ -94,11 +94,11 @@ class Options(object):
@property
def app_config(self):
# Don't go through get_app_config to avoid triggering populate().
return self.app_cache.app_configs[self.app_label]
return self.app_cache.app_configs.get(self.app_label)
@property
def installed(self):
return self.app_config.installed
return self.app_config is not None
def contribute_to_class(self, cls, name):
from django.db import connection