mirror of
https://github.com/jazzband/django-configurations.git
synced 2026-03-16 22:20:27 +00:00
Merge branch 'master' of github.com:jezdez/django-configurations
This commit is contained in:
commit
08d36754f6
2 changed files with 6 additions and 2 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in a new issue