UPD: more test.

This commit is contained in:
2019-03-14 15:36:09 +01:00
parent 3f68579b78
commit 2dce52cb25
10 changed files with 171 additions and 28 deletions

View File

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