def test_all_permission_owners(self): self.user.permissions.add(self.permission) self.assertEquals( get_all_permission_owners(self.permission).count(), 1 ) self.group.permissions.add(self.permission) self.group.users.add(self.user2) self.assertEquals( get_all_permission_owners(self.permission).count(), 2 )
def test_all_permission_owners(self): self.user2.is_superuser = True self.user2.save() self.user.permissions.add(self.permission) self.assertEquals( get_all_permission_owners(self.permission).count(), 1) self.group.permissions.add(self.permission) self.group.users.add(self.user2) self.assertEquals( get_all_permission_owners(self.permission).count(), 2) self.assertEquals( get_all_permission_owners(self.permission2, include_superuser=True).count(), 1)
def test_all_permission_owners(self): self.user2.is_superuser = True self.user2.save() self.user.permissions.add(self.permission) self.assertEquals( get_all_permission_owners(self.permission).count(), 1 ) self.group.permissions.add(self.permission) self.group.users.add(self.user2) self.assertEquals( get_all_permission_owners(self.permission).count(), 2 ) self.assertEquals( get_all_permission_owners( self.permission2, include_superuser=True ).count(), 1 )
def test_all_permission_owners(self): self.user2.is_superuser = True self.user2.save() self.user.permissions.add(self.permission, TEST_REASON, responsible=self.responsible_user) self.assertEquals( get_all_permission_owners(self.permission).count(), 1 ) self.group.permissions.add(self.permission, TEST_REASON, responsible=self.responsible_user) self.group.users.add(self.user2, TEST_REASON, responsible=self.responsible_user) self.assertEquals( get_all_permission_owners(self.permission).count(), 2 ) self.assertEquals( get_all_permission_owners( self.permission2, include_superuser=True ).count(), 1 ) self.assertEqual(self.HistoryOwnerToPermission.objects.count(), 2) # as we create generic group to user himself self.assertEqual(self.HistoryGenericUserToGroup.objects.count(), 2)