mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-03 00:25:17 +00:00
Added tests
This commit is contained in:
parent
46bc00d971
commit
0283643cbe
@ -597,12 +597,20 @@ class UserIsInGroupTest(TestCase):
|
|||||||
Test that when a user is removed from a group,
|
Test that when a user is removed from a group,
|
||||||
the is_in_group_method return False when calling it again
|
the is_in_group_method return False when calling it again
|
||||||
"""
|
"""
|
||||||
|
# testing with pk
|
||||||
self.toto.groups.add(self.com_admin.pk)
|
self.toto.groups.add(self.com_admin.pk)
|
||||||
self.assertTrue(self.toto.is_in_group(pk=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.toto.groups.remove(self.com_admin.pk)
|
||||||
self.assertFalse(self.toto.is_in_group(pk=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):
|
def test_not_existing_group(self):
|
||||||
"""
|
"""
|
||||||
Test that searching for a not existing group
|
Test that searching for a not existing group
|
||||||
|
Loading…
x
Reference in New Issue
Block a user