[FIX] Fix cached groups (#647)

This commit is contained in:
Julien Constant
2023-05-12 13:27:51 +02:00
committed by GitHub
parent 8852ef990e
commit 84768eb74e
2 changed files with 13 additions and 4 deletions

View File

@ -597,12 +597,20 @@ class UserIsInGroupTest(TestCase):
Test that when a user is removed from a group,
the is_in_group_method return False when calling it again
"""
# testing with pk
self.toto.groups.add(self.com_admin.pk)
self.assertTrue(self.toto.is_in_group(pk=self.com_admin.pk))
self.toto.groups.remove(self.com_admin.pk)
self.assertFalse(self.toto.is_in_group(pk=self.com_admin.pk))
# testing with name
self.toto.groups.add(self.sas_admin.pk)
self.assertTrue(self.toto.is_in_group(name="SAS admin"))
self.toto.groups.remove(self.sas_admin.pk)
self.assertFalse(self.toto.is_in_group(name="SAS admin"))
def test_not_existing_group(self):
"""
Test that searching for a not existing group