Beispiel #1
0
def test_save_grid_settings(db_session, root):
    from kotti_grid.utils import save_grid_settings
    from kotti_grid.utils import grid_settings

    settings = grid_settings()
    assert settings == {'tiles': [], 'grid': None}

    save_grid_settings(data='My data.', key='a_key')
    assert grid_settings()['a_key'] == 'My data.'
Beispiel #2
0
def save_grid(context, request):
    data = request.POST
    tiles = eval(data['tiles'])
    request.session.flash(
        _(u'The tiles have been saved.'), 'success')
    return save_grid_settings(tiles, 'tiles')
Beispiel #3
0
def save_grid(context, request):
    data = request.POST
    tiles = eval(data['tiles'])
    request.session.flash(
                _(u'The tiles have been saved.'), 'success')
    return save_grid_settings(tiles, 'tiles')