def permissions_form(self): from r2.lib.permissions import ModeratorPermissionSet from r2.lib.pages import ModeratorPermissions return ModeratorPermissions( user=None, permissions_type=self.type, permissions=ModeratorPermissionSet(all=True), editable=True, embedded=True, )
def test_loads(self): self.assertTrue(ModeratorPermissionSet.loads(None).is_superuser()) self.assertFalse(ModeratorPermissionSet.loads('').is_superuser())