Merge branch 'master' of github.com:jezdez/django-configurations

This commit is contained in:
Jannis Leidel 2012-09-21 16:34:35 +02:00
commit 08d36754f6
2 changed files with 6 additions and 2 deletions

View file

@ -139,11 +139,15 @@ class SettingsLoader(object):
mod = imp.load_module(fullname, *self.location)
try:
cls = getattr(mod, self.name)
obj = cls()
except AttributeError: # pragma: no cover
raise ImproperlyConfigured("Couldn't find settings '%s' in "
"module '%s'" %
(self.name, mod.__package__))
try:
obj = cls()
except Exception, err:
raise ImproperlyConfigured("Couldn't load settings '%s.%s': %s" %
(mod.__name__, self.name, err))
for name, value in uppercase_attributes(obj).items():
if callable(value):
value = value()

View file

@ -6,7 +6,7 @@ from django.core.exceptions import ImproperlyConfigured
from mock import patch
from ..importer import SettingsImporter
from configurations.importer import SettingsImporter
class MainTests(TestCase):