diff --git a/core/tests.py b/core/tests.py index 4c84662b..a2e9c526 100644 --- a/core/tests.py +++ b/core/tests.py @@ -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