2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-05 13:10:57 +00:00

Fixed permission assign test unit

This commit is contained in:
eeintech
2020-10-05 10:52:47 -05:00
parent c910307ce5
commit d980da7247
3 changed files with 6 additions and 2 deletions

View File

@ -137,7 +137,8 @@ class RuleSetModelTest(TestCase):
rule.save()
group.save()
# update_fields is required to trigger permissions update
group.save(update_fields=['name'])
# There should now be three permissions for each rule set
self.assertEqual(group.permissions.count(), 3 * len(permission_set))
@ -151,7 +152,8 @@ class RuleSetModelTest(TestCase):
rule.save()
group.save()
# update_fields is required to trigger permissions update
group.save(update_fields=['name'])
# There should now not be any permissions assigned to this group
self.assertEqual(group.permissions.count(), 0)