def test_is_admin(self): self._create_simple_setup() joe = User.objects.get(username='******') self.assertTrue(is_site_admin(joe))
def has_change_permission(self, request, obj=None): # should be available only to superusers and to site admins that # have at least one site under their control user = request.user return is_site_admin(user) and len(get_administered_sites(user)) > 0