UPD: more test.
This commit is contained in:
@@ -18,6 +18,34 @@ def skip_unless_tag_option():
|
||||
return skip('Skipped unless --tag option is used')
|
||||
|
||||
|
||||
class AppSetting(object):
|
||||
def __init__(self, name, of=None):
|
||||
self.name = name
|
||||
self.of = of
|
||||
|
||||
|
||||
class AppsTestCase(SimpleTestCase):
|
||||
app_config = None
|
||||
settings = ()
|
||||
|
||||
def setUp(self):
|
||||
super(AppsTestCase, self).setUp()
|
||||
if self.app_config:
|
||||
self.configured_settings = self.app_config.settings
|
||||
else:
|
||||
self.configured_settings = None
|
||||
|
||||
def test_settings(self):
|
||||
config = self.configured_settings
|
||||
for setting in self.settings:
|
||||
name = setting.name
|
||||
self.assertTrue(hasattr(config, name), 'Settings do not contain {}'.format(name))
|
||||
value = getattr(config, name)
|
||||
of = setting.of
|
||||
if of is not None:
|
||||
self.assertIsInstance(value, of)
|
||||
|
||||
|
||||
class Url(object):
|
||||
def __init__(self, location, name=None, func=None, **kwargs):
|
||||
self.location = location
|
||||
|
||||
Reference in New Issue
Block a user