mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
fix setting coverage
This commit is contained in:
parent
ca7230f7a8
commit
54f6c5b34f
@ -52,9 +52,28 @@ class SettingsTest(TestCase):
|
|||||||
- Ensure that every global setting has a description.
|
- Ensure that every global setting has a description.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
for key in InvenTreeSetting.SETTINGS.keys():
|
settings_dict = InvenTreeSetting.SETTINGS
|
||||||
|
# Add wrong setting
|
||||||
|
settings_dict.update({
|
||||||
|
'WRONG_SETTING_NAME': {
|
||||||
|
'name': None,
|
||||||
|
'validator': bool,
|
||||||
|
},
|
||||||
|
'WRONG_SETTING_DESC': {
|
||||||
|
'name': 'Wrong',
|
||||||
|
'description': None,
|
||||||
|
'validator': bool,
|
||||||
|
},
|
||||||
|
'wrong_SETTING_UPPER': {
|
||||||
|
'name': 'Wrong',
|
||||||
|
'description': 'Wrong',
|
||||||
|
'validator': bool,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
setting = InvenTreeSetting.SETTINGS[key]
|
for key in settings_dict.keys():
|
||||||
|
|
||||||
|
setting = settings_dict[key]
|
||||||
|
|
||||||
name = setting.get('name', None)
|
name = setting.get('name', None)
|
||||||
|
|
||||||
@ -67,7 +86,7 @@ class SettingsTest(TestCase):
|
|||||||
raise ValueError(f'Missing GLOBAL_SETTING description for {key}')
|
raise ValueError(f'Missing GLOBAL_SETTING description for {key}')
|
||||||
|
|
||||||
if not key == key.upper():
|
if not key == key.upper():
|
||||||
raise ValueError(f"SETTINGS key '{key}' is not uppercase")
|
raise ValueError(f"SETTINGS key '{key}' is not uppercase") # pragma: no cover
|
||||||
|
|
||||||
def test_defaults(self):
|
def test_defaults(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user