Ejemplo n.º 1
0
    def test_it_does_not_raise_if_group_type_is_same(self, group_data,
                                                     pyramid_csrf_request, org, user_svc):
        group = mock.Mock(type='open')
        group_data['group_type'] = 'open'
        schema = CreateAdminGroupSchema().bind(request=pyramid_csrf_request,
                                               group=group,
                                               user_svc=user_svc,
                                               organizations={org.pubid: org})

        schema.deserialize(group_data)
Ejemplo n.º 2
0
    def test_it_does_not_raise_if_group_type_is_same(self, group_data,
                                                     pyramid_csrf_request, org,
                                                     user_svc):
        group = mock.Mock(type='open')
        group_data['group_type'] = 'open'
        schema = CreateAdminGroupSchema().bind(request=pyramid_csrf_request,
                                               group=group,
                                               user_svc=user_svc,
                                               organizations={org.pubid: org})

        schema.deserialize(group_data)
Ejemplo n.º 3
0
    def test_it_raises_if_group_type_changed(self, group_data,
                                             pyramid_csrf_request, org, user_svc):
        group = mock.Mock(type='open')
        group_data['group_type'] = 'restricted'
        schema = CreateAdminGroupSchema().bind(request=pyramid_csrf_request,
                                               group=group,
                                               user_svc=user_svc,
                                               organizations={org.pubid: org})

        with pytest.raises(colander.Invalid, match='Changing group type'):
            schema.deserialize(group_data)
Ejemplo n.º 4
0
    def test_it_raises_if_group_type_changed(self, group_data,
                                             pyramid_csrf_request, org,
                                             user_svc):
        group = mock.Mock(type='open')
        group_data['group_type'] = 'restricted'
        schema = CreateAdminGroupSchema().bind(request=pyramid_csrf_request,
                                               group=group,
                                               user_svc=user_svc,
                                               organizations={org.pubid: org})

        with pytest.raises(colander.Invalid, match='Changing group type'):
            schema.deserialize(group_data)