Project

General

Profile

Bug #12345

différence de formdata.data entre pickle et sql

Added by Thomas Noël almost 8 years ago. Updated almost 8 years ago.

Status:
Rejeté
Priority:
Bas
Assignee:
-
Target version:
-
Start date:
28 June 2016
Due date:
% Done:

0%

Estimated time:
Patch proposed:
No
Planning:

Description

au détour de l'écriture d'un test, en faisant un autosave sur un formulaire, je constate ceci :

En pickle:

formdef.data_class().select()[0].data == {'1': 'bar', 'draft_formdata_id': '1', 'future_tracking_code': 'VNJBBMCX'}

Alors qu'en SQL:

{'1': 'bar', '3': None, '3_display': None}

Le test (non poussé, en cours d'écriture) dans tests/test_form_pages.py

def test_form_autosave_with_datasource(pub):
    formdef = create_formdef()
    formdef.fields = [fields.PageField(id='0', label='1st page', type='page'),
            fields.StringField(id='1', label='string', varname='foo'),
            fields.PageField(id='2', label='2nd page', type='page'),
            fields.ItemField(id='3', label='item', type='item',
                data_source = {'type': 'formula', 'value': '''[('1', form_var_foo)]'''})]
    formdef.enable_tracking_codes = True
    formdef.store()

    formdef.data_class().wipe()
    app = get_app(pub)
    resp = app.get('/test/')
    resp.form['f1'] = 'bar'

    app.post('/test/autosave', params=resp.form.submit_fields())
    assert formdef.data_class().count() == 1
    formdata = formdef.data_class().select()[0]
    assert formdata.status == 'draft'
    assert formdef.data_class().select()[0].data['1'] == 'bar'
    assert formdef.data_class().select()[0].data == 'SHOW-ME-FAIL'  # pour voir ce que data contient

History

#1

Updated by Thomas Noël almost 8 years ago

  • Status changed from Nouveau to Rejeté

not a bug, ça gène pas

Also available in: Atom PDF