FIX/UPD: tests are OK with python3.

This commit is contained in:
2019-03-28 22:11:00 +01:00
parent 943285f1ed
commit 03bdc0f7c1
4 changed files with 7 additions and 7 deletions

View File

@@ -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):