mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-05 13:10:57 +00:00
Add some more unit testing
- ALL models must be covered by rulesets - Added a RULESET_IGNORE list for models we do not want permissions for
This commit is contained in:
@ -76,15 +76,17 @@ class RuleSetModelTest(TestCase):
|
||||
print("{n} is not a valid database table".format(n=m))
|
||||
errors += 1
|
||||
|
||||
self.assertEqual(errors, 0)
|
||||
|
||||
missing_models = []
|
||||
|
||||
for model in available_tables:
|
||||
if model not in assigned_models:
|
||||
if model not in assigned_models and model not in RuleSet.RULESET_IGNORE:
|
||||
missing_models.append(model)
|
||||
|
||||
if len(missing_models) > 0:
|
||||
print("WARNING: The following database models are not covered by the define RuleSet permissions:")
|
||||
print("The following database models are not covered by the defined RuleSet permissions:")
|
||||
for m in missing_models:
|
||||
print("-", m)
|
||||
|
||||
self.assertEqual(errors, 0)
|
||||
self.assertEqual(len(missing_models), 0)
|
Reference in New Issue
Block a user