Added tests

This commit is contained in:
Julien Constant 2023-05-12 12:10:44 +02:00
parent 46bc00d971
commit 0283643cbe
No known key found for this signature in database
GPG Key ID: 816E7C070117E5B7
1 changed files with 8 additions and 0 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