FIX/UPD: tests are OK with python3.
This commit is contained in:
@@ -21,10 +21,10 @@ class DefaultSetting(object):
|
||||
if hasattr(self, 'validator') and self.validator is not None:
|
||||
if callable(self.validator):
|
||||
if not self.validator(value):
|
||||
raise ImproperlyConfigured("Validator callback {clb} returned False".format(clb=self.validator))
|
||||
raise ImproperlyConfigured('Validator callback {clb} returned False'.format(clb=self.validator))
|
||||
else:
|
||||
if not re.search(self.validator, value):
|
||||
raise ImproperlyConfigured("Does not match /{re}/".format(re=self.validator))
|
||||
raise ImproperlyConfigured('Does not match /{re}/'.format(re=self.validator))
|
||||
|
||||
|
||||
class AppSettings(object):
|
||||
@@ -44,7 +44,7 @@ class AppSettings(object):
|
||||
except ImproperlyConfigured as e:
|
||||
msg = 'Invalid value of {key} in {module}: {cause}'.format(key=default.key_name,
|
||||
module=settings_name,
|
||||
cause=e.message)
|
||||
cause=e)
|
||||
raise ImproperlyConfigured(msg)
|
||||
setattr(self, default.name, value)
|
||||
elif isinstance(default.value, ImproperlyConfigured):
|
||||
|
||||
Reference in New Issue
Block a user