coverage-py27-django18-pylint-pg installed: apipkg==1.4,atomicwrites==1.1.5,attrs==18.1.0,beautifulsoup4==4.6.0,certifi==2018.4.16,chardet==3.0.4,coverage==4.5.1,cssselect==1.0.3,Django==1.8.19,docutils==0.14,execnet==1.5.0,feedparser==5.2.1,funcsigs==1.0.2,gadjo==0.55,html5lib==1.0.1,idna==2.7,lxml==4.2.1,mechanize==0.3.6,mock==2.0.0,more-itertools==4.2.0,pbr==4.0.4,Pillow==5.1.0,pkg-resources==0.0.0,pluggy==0.6.0,psycopg2==2.7.4,py==1.5.3,pyquery==1.4.0,pytest==3.6.1,pytest-cov==2.5.1,pytest-django==3.2.1,pytest-forked==0.2,pytest-mock==1.10.0,pytest-xdist==1.22.2,python-dateutil==2.7.3,python-magic==0.4.15,qrcode==6.0,Quixote==2.7b2,requests==2.19.0,scgi==1.15,six==1.11.0,urllib3==1.23,vobject==0.9.5,waitress==1.1.0,wcs===2.80.5.ga2fab65a,webencodings==0.5.1,WebOb==1.8.2,WebTest==2.0.29,xlwt==1.3.0,XStatic==1.0.1,XStatic-Font-Awesome==4.7.0.0,XStatic-jQuery==1.10.2.1,XStatic-jquery-ui==1.12.0.1,XStatic-OpenSans==1.0.0 coverage-py27-django18-pylint-pg runtests: PYTHONHASHSEED='1523384933' coverage-py27-django18-pylint-pg runtests: commands[0] | ./getlasso.sh '/tmp/tox-chris/wcs/coverage-py27-django18-pylint-pg/lib/python2.7/site-packages/lasso.py' -> '/usr/lib/python2.7/dist-packages/lasso.py' '/tmp/tox-chris/wcs/coverage-py27-django18-pylint-pg/lib/python2.7/site-packages/_lasso.x86_64-linux-gnu.so' -> '/usr/lib/python2.7/dist-packages/_lasso.x86_64-linux-gnu.so' coverage-py27-django18-pylint-pg runtests: commands[1] | py.test --junit-xml=test_results.xml --cov=wcs --cov-report xml --cov-config .coveragerc tests ============================= test session starts ============================== platform linux2 -- Python 2.7.13, pytest-3.6.1, py-1.5.3, pluggy-0.6.0 Django settings: wcs.settings (from environment variable) rootdir: /home/chris/src/wcs, inifile: plugins: xdist-1.22.2, mock-1.10.0, forked-0.2, django-3.2.1, cov-2.5.1 collected 1411 items tests/test_admin_pages.py .............................................. [ 3%] .............................................s.......................... [ 8%] ........................................................................ [ 13%] ......................................................FF................ [ 18%] ....................s. [ 20%] tests/test_api.py ...................................................... [ 23%] ....................................s.s....................... [ 28%] tests/test_auth_pages.py .... [ 28%] tests/test_backoffice_pages.py ..........s.s............................ [ 31%] .....................................................................s.s [ 36%] .s.s.s...s.s.....s.s.....s...s.....s.s........................... [ 41%] tests/test_bounce_processing.py .. [ 41%] tests/test_categories.py ......... [ 42%] tests/test_ctl.py ............. [ 42%] tests/test_datasource.py ............. [ 43%] tests/test_ezt.py ............... [ 44%] tests/test_fc_auth.py ... [ 45%] tests/test_fields.py ...................... [ 46%] tests/test_form_pages.py ........FF..................................... [ 50%] ........................................................................ [ 55%] ........................................................................ [ 60%] .........................................FF.................... [ 64%] tests/test_formdata.py ............................................ [ 67%] tests/test_formdef.py ........................ [ 69%] tests/test_formdef_import.py ........................ [ 71%] tests/test_hobo.py ....... [ 71%] tests/test_hobo_notify.py .............. [ 72%] tests/test_misc.py ....F.......................... [ 74%] tests/test_prefill.py ........F [ 75%] tests/test_publisher.py ........ [ 76%] tests/test_register.py ...................... [ 77%] tests/test_role.py .... [ 77%] tests/test_rootdirectory.py ........... [ 78%] tests/test_saml2utils.py . [ 78%] tests/test_saml_auth.py .............................. [ 80%] tests/test_sessions.py ........ [ 81%] tests/test_sql.py ...................................................... [ 85%] .................s [ 86%] tests/test_storage.py ....................... [ 88%] tests/test_strftime.py .. [ 88%] tests/test_templates.py ..... [ 88%] tests/test_texts.py .... [ 89%] tests/test_tracking_code.py .... [ 89%] tests/test_users.py ... [ 89%] tests/test_variadic_url.py .................... [ 90%] tests/test_widgets.py ..................... [ 92%] tests/test_workflow_import.py .............................. [ 94%] tests/test_workflows.py ................................................ [ 97%] ....................... [ 99%] tests/test_wscall.py ..... [ 99%] tests/test_x509utils.py . [100%] =================================== FAILURES =================================== _______________________ test_settings_filetypes[pickle] ________________________ pub = def test_settings_filetypes(pub): create_superuser(pub) app = login(get_app(pub)) resp = app.get('/backoffice/settings/filetypes/') assert 'There are no file type defined at the moment.' in resp.body resp.forms[0]['label'] = 'Text files' resp.forms[0]['mimetypes'] = '.odt' resp = resp.forms[0].submit('submit') assert resp.location == 'http://example.net/backoffice/settings/filetypes/' resp = resp.follow() assert pub.cfg['filetypes'][1]['label'] == 'Text files' resp = resp.click('Text files') assert resp.forms[0]['mimetypes'].value == 'application/vnd.oasis.opendocument.text' resp.forms[0]['mimetypes'] = 'application/vnd.oasis.opendocument.text, .doc, .docx, .pdf' resp = resp.forms[0].submit('submit') assert resp.location == 'http://example.net/backoffice/settings/filetypes/' resp = resp.follow() > assert 'application/msword (.doc)' in resp.body E assert 'application/msword (.doc)' in '\n\n \n \n Back Office of wcs - File Types\n ... \n\n \n \n \n\n' E + where '\n\n \n \n Back Office of wcs - File Types\n ... \n\n \n \n \n\n' = <200 OK text/html body='\n'/3990>.body tests/test_admin_pages.py:4071: AssertionError _________________________ test_settings_filetypes[sql] _________________________ pub = def test_settings_filetypes(pub): create_superuser(pub) app = login(get_app(pub)) resp = app.get('/backoffice/settings/filetypes/') assert 'There are no file type defined at the moment.' in resp.body resp.forms[0]['label'] = 'Text files' resp.forms[0]['mimetypes'] = '.odt' resp = resp.forms[0].submit('submit') assert resp.location == 'http://example.net/backoffice/settings/filetypes/' resp = resp.follow() assert pub.cfg['filetypes'][1]['label'] == 'Text files' resp = resp.click('Text files') assert resp.forms[0]['mimetypes'].value == 'application/vnd.oasis.opendocument.text' resp.forms[0]['mimetypes'] = 'application/vnd.oasis.opendocument.text, .doc, .docx, .pdf' resp = resp.forms[0].submit('submit') assert resp.location == 'http://example.net/backoffice/settings/filetypes/' resp = resp.follow() > assert 'application/msword (.doc)' in resp.body E assert 'application/msword (.doc)' in '\n\n \n \n Back Office of wcs - File Types\n ... \n\n \n \n \n\n' E + where '\n\n \n \n Back Office of wcs - File Types\n ... \n\n \n \n \n\n' = <200 OK text/html body='\n'/3990>.body tests/test_admin_pages.py:4071: AssertionError __________________________ test_home_keywords[pickle] __________________________ pub = def test_home_keywords(pub): formdef = create_formdef() formdef.category_id = '1' formdef.keywords = 'hello, world' formdef.store() home = get_app(pub).get('/') > assert '
\n\nForms\nLogin

\n
\n\n\n\n' or '
\n\nForms\nLogin

\n
\n\n\n\n') E + where '\n\n\nForms\nLogin

\n\n\n\n\n' = <200 OK text/html body=''/559>.body E + and '\n\n\nForms\nLogin

\n\n\n\n\n' = <200 OK text/html body=''/559>.body tests/test_form_pages.py:215: AssertionError ___________________________ test_home_keywords[sql] ____________________________ pub = def test_home_keywords(pub): formdef = create_formdef() formdef.category_id = '1' formdef.keywords = 'hello, world' formdef.store() home = get_app(pub).get('/') > assert '
\n\nForms\nLogin

\n
\n\n\n\n' or '
\n\nForms\nLogin

\n
\n\n\n\n') E + where '\n\n\nForms\nLogin

\n\n\n\n\n' = <200 OK text/html body=''/559>.body E + and '\n\n\nForms\nLogin

\n\n\n\n\n' = <200 OK text/html body=''/559>.body tests/test_form_pages.py:215: AssertionError _________________ test_item_field_with_disabled_items[pickle] __________________ http_requests = pub = def test_item_field_with_disabled_items(http_requests, pub): user = create_user(pub) formdef = create_formdef() formdef.data_class().wipe() ds = {'type': 'json', 'value': 'http://remote.example.net/json'} formdef.fields = [fields.ItemField(id='0', label='string', type='item', data_source=ds, display_disabled_items=True)] formdef.store() with mock.patch('qommon.misc.urlopen') as urlopen: data = {'data': [{'id': '1', 'text': 'hello'}, {'id': '2', 'text': 'world'}]} urlopen.side_effect = lambda *args: StringIO.StringIO(json.dumps(data)) resp = get_app(pub).get('/test/') resp.form['f0'] = '1' resp.form['f0'] = '2' resp = resp.form.submit('submit') # -> validation page resp = resp.form.submit('submit') # -> submit assert formdef.data_class().select()[0].data['0'] == '2' assert formdef.data_class().select()[0].data['0_display'] == 'world' formdef.data_class().wipe() with mock.patch('qommon.misc.urlopen') as urlopen: data = {'data': [{'id': '1', 'text': 'hello', 'disabled': True}, {'id': '2', 'text': 'world'}]} urlopen.side_effect = lambda *args: StringIO.StringIO(json.dumps(data)) resp = get_app(pub).get('/test/') assert '' in resp.body resp.form['f0'] = '1' resp.form['f0'] = '2' resp = resp.form.submit('submit') # -> validation page resp = resp.form.submit('submit') # -> submit assert formdef.data_class().select()[0].data['0'] == '2' assert formdef.data_class().select()[0].data['0_display'] == 'world' resp = get_app(pub).get('/test/') assert '' in resp.body resp.form['f0'] = '1' resp = resp.form.submit('submit') # -> validation page assert 'There were errors processing the form' in resp.body formdef.data_class().wipe() formdef.fields = [fields.ItemField(id='0', label='string', type='item', data_source=ds, display_disabled_items=False)] formdef.store() with mock.patch('qommon.misc.urlopen') as urlopen: data = {'data': [{'id': '1', 'text': 'hello', 'disabled': True}, {'id': '2', 'text': 'world'}]} urlopen.side_effect = lambda *args: StringIO.StringIO(json.dumps(data)) resp = get_app(pub).get('/test/') assert not '' in resp.body resp.form['f0'] = '2' resp = resp.form.submit('submit') # -> validation page resp = resp.form.submit('submit') # -> submit assert formdef.data_class().select()[0].data['0'] == '2' assert formdef.data_class().select()[0].data['0_display'] == 'world' formdef.data_class().wipe() formdef.fields = [fields.ItemField(id='0', label='string', type='item', data_source=ds, show_as_radio=True, display_disabled_items=True)] formdef.store() with mock.patch('qommon.misc.urlopen') as urlopen: data = {'data': [{'id': '1', 'text': 'hello'}, {'id': '2', 'text': 'world'}]} urlopen.side_effect = lambda *args: StringIO.StringIO(json.dumps(data)) resp = get_app(pub).get('/test/') resp.form['f0'] = '1' resp.form['f0'] = '2' resp = resp.form.submit('submit') # -> validation page resp = resp.form.submit('submit') # -> submit assert formdef.data_class().select()[0].data['0'] == '2' assert formdef.data_class().select()[0].data['0_display'] == 'world' formdef.data_class().wipe() with mock.patch('qommon.misc.urlopen') as urlopen: data = {'data': [{'id': '1', 'text': 'hello', 'disabled': True}, {'id': '2', 'text': 'world'}]} urlopen.side_effect = lambda *args: StringIO.StringIO(json.dumps(data)) resp = get_app(pub).get('/test/') > assert '' in resp.body E assert '' in '\n\n\nForms - test\n\n\n\n\n\n' E + where '\n\n\nForms - test\n\n\n\n\n\n' = <200 OK text/html body=''/1887>.body tests/test_form_pages.py:4379: AssertionError ___________________ test_item_field_with_disabled_items[sql] ___________________ http_requests = pub = def test_item_field_with_disabled_items(http_requests, pub): user = create_user(pub) formdef = create_formdef() formdef.data_class().wipe() ds = {'type': 'json', 'value': 'http://remote.example.net/json'} formdef.fields = [fields.ItemField(id='0', label='string', type='item', data_source=ds, display_disabled_items=True)] formdef.store() with mock.patch('qommon.misc.urlopen') as urlopen: data = {'data': [{'id': '1', 'text': 'hello'}, {'id': '2', 'text': 'world'}]} urlopen.side_effect = lambda *args: StringIO.StringIO(json.dumps(data)) resp = get_app(pub).get('/test/') resp.form['f0'] = '1' resp.form['f0'] = '2' resp = resp.form.submit('submit') # -> validation page resp = resp.form.submit('submit') # -> submit assert formdef.data_class().select()[0].data['0'] == '2' assert formdef.data_class().select()[0].data['0_display'] == 'world' formdef.data_class().wipe() with mock.patch('qommon.misc.urlopen') as urlopen: data = {'data': [{'id': '1', 'text': 'hello', 'disabled': True}, {'id': '2', 'text': 'world'}]} urlopen.side_effect = lambda *args: StringIO.StringIO(json.dumps(data)) resp = get_app(pub).get('/test/') assert '' in resp.body resp.form['f0'] = '1' resp.form['f0'] = '2' resp = resp.form.submit('submit') # -> validation page resp = resp.form.submit('submit') # -> submit assert formdef.data_class().select()[0].data['0'] == '2' assert formdef.data_class().select()[0].data['0_display'] == 'world' resp = get_app(pub).get('/test/') assert '' in resp.body resp.form['f0'] = '1' resp = resp.form.submit('submit') # -> validation page assert 'There were errors processing the form' in resp.body formdef.data_class().wipe() formdef.fields = [fields.ItemField(id='0', label='string', type='item', data_source=ds, display_disabled_items=False)] formdef.store() with mock.patch('qommon.misc.urlopen') as urlopen: data = {'data': [{'id': '1', 'text': 'hello', 'disabled': True}, {'id': '2', 'text': 'world'}]} urlopen.side_effect = lambda *args: StringIO.StringIO(json.dumps(data)) resp = get_app(pub).get('/test/') assert not '' in resp.body resp.form['f0'] = '2' resp = resp.form.submit('submit') # -> validation page resp = resp.form.submit('submit') # -> submit assert formdef.data_class().select()[0].data['0'] == '2' assert formdef.data_class().select()[0].data['0_display'] == 'world' formdef.data_class().wipe() formdef.fields = [fields.ItemField(id='0', label='string', type='item', data_source=ds, show_as_radio=True, display_disabled_items=True)] formdef.store() with mock.patch('qommon.misc.urlopen') as urlopen: data = {'data': [{'id': '1', 'text': 'hello'}, {'id': '2', 'text': 'world'}]} urlopen.side_effect = lambda *args: StringIO.StringIO(json.dumps(data)) resp = get_app(pub).get('/test/') resp.form['f0'] = '1' resp.form['f0'] = '2' resp = resp.form.submit('submit') # -> validation page resp = resp.form.submit('submit') # -> submit assert formdef.data_class().select()[0].data['0'] == '2' assert formdef.data_class().select()[0].data['0_display'] == 'world' formdef.data_class().wipe() with mock.patch('qommon.misc.urlopen') as urlopen: data = {'data': [{'id': '1', 'text': 'hello', 'disabled': True}, {'id': '2', 'text': 'world'}]} urlopen.side_effect = lambda *args: StringIO.StringIO(json.dumps(data)) resp = get_app(pub).get('/test/') > assert '' in resp.body E assert '' in '\n\n\nForms - test\n\n\n\n\n\n' E + where '\n\n\nForms - test\n\n\n\n\n\n' = <200 OK text/html body=''/1887>.body tests/test_form_pages.py:4379: AssertionError ____________________________ test_format_mimetypes _____________________________ def test_format_mimetypes(): assert FileTypesDirectory.format_mimetypes(['application/pdf']) == \ 'application/pdf (.pdf)' assert FileTypesDirectory.format_mimetypes(['application/pdf', 'text/rtf']) == \ 'application/pdf (.pdf), text/rtf' > assert FileTypesDirectory.format_mimetypes(['application/pdf', 'application/msword']) == \ 'application/pdf (.pdf), application/msword (.doc)' E AssertionError: assert 'application/...msword (.dot)' == 'application/p...msword (.doc)' E Skipping 37 identical leading characters in diff, use -v to show E - sword (.dot) E ? ^ E + sword (.doc) E ? ^ tests/test_misc.py:70: AssertionError _______________________ test_prefill_formula_time_value ________________________ def test_prefill_formula_time_value(): pub.substitutions.get_context_variables = lambda: {} field = fields.Field() field.prefill = {'type': 'formula', 'value': 'utils.make_datetime("2018-04-04 10:05").time()'} > assert field.get_prefill_value() == ('10:05 a.m.', False) E AssertionError: assert ('10:05', False) == ('10:05 a.m.', False) E At index 0 diff: '10:05' != '10:05 a.m.' E Use -v to get the full diff tests/test_prefill.py:105: AssertionError ----------- generated xml file: /home/chris/src/wcs/test_results.xml ----------- ---------- coverage: platform linux2, python 2.7.13-final-0 ---------- Coverage XML written to file coverage.xml ============= 8 failed, 1383 passed, 20 skipped in 515.52 seconds ============== ERROR: InvocationError: '/tmp/tox-chris/wcs/coverage-py27-django18-pylint-pg/bin/py.test --junit-xml=test_results.xml --cov=wcs --cov-report xml --cov-config .coveragerc tests' coverage-py27-django111-pylint-pg installed: apipkg==1.4,atomicwrites==1.1.5,attrs==18.1.0,beautifulsoup4==4.6.0,certifi==2018.4.16,chardet==3.0.4,coverage==4.5.1,cssselect==1.0.3,Django==1.11.13,docutils==0.14,execnet==1.5.0,feedparser==5.2.1,funcsigs==1.0.2,gadjo==0.55,html5lib==1.0.1,idna==2.7,lxml==4.2.1,mechanize==0.3.6,mock==2.0.0,more-itertools==4.2.0,pbr==4.0.4,Pillow==5.1.0,pkg-resources==0.0.0,pluggy==0.6.0,psycopg2==2.7.4,py==1.5.3,pyquery==1.4.0,pytest==3.6.1,pytest-cov==2.5.1,pytest-django==3.2.1,pytest-forked==0.2,pytest-mock==1.10.0,pytest-xdist==1.22.2,python-dateutil==2.7.3,python-magic==0.4.15,pytz==2018.4,qrcode==6.0,Quixote==2.7b2,requests==2.19.0,scgi==1.15,six==1.11.0,urllib3==1.23,vobject==0.9.5,waitress==1.1.0,wcs===2.80.5.ga2fab65a,webencodings==0.5.1,WebOb==1.8.2,WebTest==2.0.29,xlwt==1.3.0,XStatic==1.0.1,XStatic-Font-Awesome==4.7.0.0,XStatic-jQuery==1.10.2.1,XStatic-jquery-ui==1.12.0.1,XStatic-OpenSans==1.0.0 coverage-py27-django111-pylint-pg runtests: PYTHONHASHSEED='1523384933' coverage-py27-django111-pylint-pg runtests: commands[0] | ./getlasso.sh '/tmp/tox-chris/wcs/coverage-py27-django111-pylint-pg/lib/python2.7/site-packages/lasso.py' -> '/usr/lib/python2.7/dist-packages/lasso.py' '/tmp/tox-chris/wcs/coverage-py27-django111-pylint-pg/lib/python2.7/site-packages/_lasso.x86_64-linux-gnu.so' -> '/usr/lib/python2.7/dist-packages/_lasso.x86_64-linux-gnu.so' coverage-py27-django111-pylint-pg runtests: commands[1] | py.test --junit-xml=test_results.xml --cov=wcs --cov-report xml --cov-config .coveragerc tests ============================= test session starts ============================== platform linux2 -- Python 2.7.13, pytest-3.6.1, py-1.5.3, pluggy-0.6.0 Django settings: wcs.settings (from environment variable) rootdir: /home/chris/src/wcs, inifile: plugins: xdist-1.22.2, mock-1.10.0, forked-0.2, django-3.2.1, cov-2.5.1 collected 1411 items tests/test_admin_pages.py .............................................. [ 3%] .............................................s.......................... [ 8%] ........................................................................ [ 13%] ......................................................FF................ [ 18%] ....................s. [ 20%] tests/test_api.py ...................................................... [ 23%] ....................................s.s....................... [ 28%] tests/test_auth_pages.py .... [ 28%] tests/test_backoffice_pages.py ..........s.s............................ [ 31%] .....................................................................s.s [ 36%] .s.s.s...s.s.....s.s.....s...s.....s.s........................... [ 41%] tests/test_bounce_processing.py .. [ 41%] tests/test_categories.py ......... [ 42%] tests/test_ctl.py ............. [ 42%] tests/test_datasource.py ............. [ 43%] tests/test_ezt.py ............... [ 44%] tests/test_fc_auth.py ... [ 45%] tests/test_fields.py ...................... [ 46%] tests/test_form_pages.py ........FF..................................... [ 50%] ........................................................................ [ 55%] ........................................................................ [ 60%] .........................................FF.................... [ 64%] tests/test_formdata.py ............................................ [ 67%] tests/test_formdef.py ........................ [ 69%] tests/test_formdef_import.py ........................ [ 71%] tests/test_hobo.py ....... [ 71%] tests/test_hobo_notify.py .............. [ 72%] tests/test_misc.py ....F.......................... [ 74%] tests/test_prefill.py ........F [ 75%] tests/test_publisher.py ........ [ 76%] tests/test_register.py ...................... [ 77%] tests/test_role.py .... [ 77%] tests/test_rootdirectory.py ........... [ 78%] tests/test_saml2utils.py . [ 78%] tests/test_saml_auth.py .............................. [ 80%] tests/test_sessions.py ........ [ 81%] tests/test_sql.py ...................................................... [ 85%] .................s [ 86%] tests/test_storage.py ....................... [ 88%] tests/test_strftime.py .. [ 88%] tests/test_templates.py ..... [ 88%] tests/test_texts.py .... [ 89%] tests/test_tracking_code.py .... [ 89%] tests/test_users.py ... [ 89%] tests/test_variadic_url.py .................... [ 90%] tests/test_widgets.py ..................... [ 92%] tests/test_workflow_import.py .............................. [ 94%] tests/test_workflows.py ................................................ [ 97%] ....................... [ 99%] tests/test_wscall.py ..... [ 99%] tests/test_x509utils.py . [100%] =================================== FAILURES =================================== _______________________ test_settings_filetypes[pickle] ________________________ pub = def test_settings_filetypes(pub): create_superuser(pub) app = login(get_app(pub)) resp = app.get('/backoffice/settings/filetypes/') assert 'There are no file type defined at the moment.' in resp.body resp.forms[0]['label'] = 'Text files' resp.forms[0]['mimetypes'] = '.odt' resp = resp.forms[0].submit('submit') assert resp.location == 'http://example.net/backoffice/settings/filetypes/' resp = resp.follow() assert pub.cfg['filetypes'][1]['label'] == 'Text files' resp = resp.click('Text files') assert resp.forms[0]['mimetypes'].value == 'application/vnd.oasis.opendocument.text' resp.forms[0]['mimetypes'] = 'application/vnd.oasis.opendocument.text, .doc, .docx, .pdf' resp = resp.forms[0].submit('submit') assert resp.location == 'http://example.net/backoffice/settings/filetypes/' resp = resp.follow() > assert 'application/msword (.doc)' in resp.body E assert 'application/msword (.doc)' in '\n\n \n \n Back Office of wcs - File Types\n ... \n\n \n \n \n\n' E + where '\n\n \n \n Back Office of wcs - File Types\n ... \n\n \n \n \n\n' = <200 OK text/html body='\n'/3990>.body tests/test_admin_pages.py:4071: AssertionError _________________________ test_settings_filetypes[sql] _________________________ pub = def test_settings_filetypes(pub): create_superuser(pub) app = login(get_app(pub)) resp = app.get('/backoffice/settings/filetypes/') assert 'There are no file type defined at the moment.' in resp.body resp.forms[0]['label'] = 'Text files' resp.forms[0]['mimetypes'] = '.odt' resp = resp.forms[0].submit('submit') assert resp.location == 'http://example.net/backoffice/settings/filetypes/' resp = resp.follow() assert pub.cfg['filetypes'][1]['label'] == 'Text files' resp = resp.click('Text files') assert resp.forms[0]['mimetypes'].value == 'application/vnd.oasis.opendocument.text' resp.forms[0]['mimetypes'] = 'application/vnd.oasis.opendocument.text, .doc, .docx, .pdf' resp = resp.forms[0].submit('submit') assert resp.location == 'http://example.net/backoffice/settings/filetypes/' resp = resp.follow() > assert 'application/msword (.doc)' in resp.body E assert 'application/msword (.doc)' in '\n\n \n \n Back Office of wcs - File Types\n ... \n\n \n \n \n\n' E + where '\n\n \n \n Back Office of wcs - File Types\n ... \n\n \n \n \n\n' = <200 OK text/html body='\n'/3990>.body tests/test_admin_pages.py:4071: AssertionError __________________________ test_home_keywords[pickle] __________________________ pub = def test_home_keywords(pub): formdef = create_formdef() formdef.category_id = '1' formdef.keywords = 'hello, world' formdef.store() home = get_app(pub).get('/') > assert '
\n\nForms\nLogin

\n
\n\n\n\n' or '
\n\nForms\nLogin

\n
\n\n\n\n') E + where '\n\n\nForms\nLogin

\n\n\n\n\n' = <200 OK text/html body=''/559>.body E + and '\n\n\nForms\nLogin

\n\n\n\n\n' = <200 OK text/html body=''/559>.body tests/test_form_pages.py:215: AssertionError ___________________________ test_home_keywords[sql] ____________________________ pub = def test_home_keywords(pub): formdef = create_formdef() formdef.category_id = '1' formdef.keywords = 'hello, world' formdef.store() home = get_app(pub).get('/') > assert '
\n\nForms\nLogin

\n
\n\n\n\n' or '
\n\nForms\nLogin

\n
\n\n\n\n') E + where '\n\n\nForms\nLogin

\n\n\n\n\n' = <200 OK text/html body=''/559>.body E + and '\n\n\nForms\nLogin

\n\n\n\n\n' = <200 OK text/html body=''/559>.body tests/test_form_pages.py:215: AssertionError _________________ test_item_field_with_disabled_items[pickle] __________________ http_requests = pub = def test_item_field_with_disabled_items(http_requests, pub): user = create_user(pub) formdef = create_formdef() formdef.data_class().wipe() ds = {'type': 'json', 'value': 'http://remote.example.net/json'} formdef.fields = [fields.ItemField(id='0', label='string', type='item', data_source=ds, display_disabled_items=True)] formdef.store() with mock.patch('qommon.misc.urlopen') as urlopen: data = {'data': [{'id': '1', 'text': 'hello'}, {'id': '2', 'text': 'world'}]} urlopen.side_effect = lambda *args: StringIO.StringIO(json.dumps(data)) resp = get_app(pub).get('/test/') resp.form['f0'] = '1' resp.form['f0'] = '2' resp = resp.form.submit('submit') # -> validation page resp = resp.form.submit('submit') # -> submit assert formdef.data_class().select()[0].data['0'] == '2' assert formdef.data_class().select()[0].data['0_display'] == 'world' formdef.data_class().wipe() with mock.patch('qommon.misc.urlopen') as urlopen: data = {'data': [{'id': '1', 'text': 'hello', 'disabled': True}, {'id': '2', 'text': 'world'}]} urlopen.side_effect = lambda *args: StringIO.StringIO(json.dumps(data)) resp = get_app(pub).get('/test/') assert '' in resp.body resp.form['f0'] = '1' resp.form['f0'] = '2' resp = resp.form.submit('submit') # -> validation page resp = resp.form.submit('submit') # -> submit assert formdef.data_class().select()[0].data['0'] == '2' assert formdef.data_class().select()[0].data['0_display'] == 'world' resp = get_app(pub).get('/test/') assert '' in resp.body resp.form['f0'] = '1' resp = resp.form.submit('submit') # -> validation page assert 'There were errors processing the form' in resp.body formdef.data_class().wipe() formdef.fields = [fields.ItemField(id='0', label='string', type='item', data_source=ds, display_disabled_items=False)] formdef.store() with mock.patch('qommon.misc.urlopen') as urlopen: data = {'data': [{'id': '1', 'text': 'hello', 'disabled': True}, {'id': '2', 'text': 'world'}]} urlopen.side_effect = lambda *args: StringIO.StringIO(json.dumps(data)) resp = get_app(pub).get('/test/') assert not '' in resp.body resp.form['f0'] = '2' resp = resp.form.submit('submit') # -> validation page resp = resp.form.submit('submit') # -> submit assert formdef.data_class().select()[0].data['0'] == '2' assert formdef.data_class().select()[0].data['0_display'] == 'world' formdef.data_class().wipe() formdef.fields = [fields.ItemField(id='0', label='string', type='item', data_source=ds, show_as_radio=True, display_disabled_items=True)] formdef.store() with mock.patch('qommon.misc.urlopen') as urlopen: data = {'data': [{'id': '1', 'text': 'hello'}, {'id': '2', 'text': 'world'}]} urlopen.side_effect = lambda *args: StringIO.StringIO(json.dumps(data)) resp = get_app(pub).get('/test/') resp.form['f0'] = '1' resp.form['f0'] = '2' resp = resp.form.submit('submit') # -> validation page resp = resp.form.submit('submit') # -> submit assert formdef.data_class().select()[0].data['0'] == '2' assert formdef.data_class().select()[0].data['0_display'] == 'world' formdef.data_class().wipe() with mock.patch('qommon.misc.urlopen') as urlopen: data = {'data': [{'id': '1', 'text': 'hello', 'disabled': True}, {'id': '2', 'text': 'world'}]} urlopen.side_effect = lambda *args: StringIO.StringIO(json.dumps(data)) resp = get_app(pub).get('/test/') > assert '' in resp.body E assert '' in '\n\n\nForms - test\n\n\n\n\n\n' E + where '\n\n\nForms - test\n\n\n\n\n\n' = <200 OK text/html body=''/1887>.body tests/test_form_pages.py:4379: AssertionError ___________________ test_item_field_with_disabled_items[sql] ___________________ http_requests = pub = def test_item_field_with_disabled_items(http_requests, pub): user = create_user(pub) formdef = create_formdef() formdef.data_class().wipe() ds = {'type': 'json', 'value': 'http://remote.example.net/json'} formdef.fields = [fields.ItemField(id='0', label='string', type='item', data_source=ds, display_disabled_items=True)] formdef.store() with mock.patch('qommon.misc.urlopen') as urlopen: data = {'data': [{'id': '1', 'text': 'hello'}, {'id': '2', 'text': 'world'}]} urlopen.side_effect = lambda *args: StringIO.StringIO(json.dumps(data)) resp = get_app(pub).get('/test/') resp.form['f0'] = '1' resp.form['f0'] = '2' resp = resp.form.submit('submit') # -> validation page resp = resp.form.submit('submit') # -> submit assert formdef.data_class().select()[0].data['0'] == '2' assert formdef.data_class().select()[0].data['0_display'] == 'world' formdef.data_class().wipe() with mock.patch('qommon.misc.urlopen') as urlopen: data = {'data': [{'id': '1', 'text': 'hello', 'disabled': True}, {'id': '2', 'text': 'world'}]} urlopen.side_effect = lambda *args: StringIO.StringIO(json.dumps(data)) resp = get_app(pub).get('/test/') assert '' in resp.body resp.form['f0'] = '1' resp.form['f0'] = '2' resp = resp.form.submit('submit') # -> validation page resp = resp.form.submit('submit') # -> submit assert formdef.data_class().select()[0].data['0'] == '2' assert formdef.data_class().select()[0].data['0_display'] == 'world' resp = get_app(pub).get('/test/') assert '' in resp.body resp.form['f0'] = '1' resp = resp.form.submit('submit') # -> validation page assert 'There were errors processing the form' in resp.body formdef.data_class().wipe() formdef.fields = [fields.ItemField(id='0', label='string', type='item', data_source=ds, display_disabled_items=False)] formdef.store() with mock.patch('qommon.misc.urlopen') as urlopen: data = {'data': [{'id': '1', 'text': 'hello', 'disabled': True}, {'id': '2', 'text': 'world'}]} urlopen.side_effect = lambda *args: StringIO.StringIO(json.dumps(data)) resp = get_app(pub).get('/test/') assert not '' in resp.body resp.form['f0'] = '2' resp = resp.form.submit('submit') # -> validation page resp = resp.form.submit('submit') # -> submit assert formdef.data_class().select()[0].data['0'] == '2' assert formdef.data_class().select()[0].data['0_display'] == 'world' formdef.data_class().wipe() formdef.fields = [fields.ItemField(id='0', label='string', type='item', data_source=ds, show_as_radio=True, display_disabled_items=True)] formdef.store() with mock.patch('qommon.misc.urlopen') as urlopen: data = {'data': [{'id': '1', 'text': 'hello'}, {'id': '2', 'text': 'world'}]} urlopen.side_effect = lambda *args: StringIO.StringIO(json.dumps(data)) resp = get_app(pub).get('/test/') resp.form['f0'] = '1' resp.form['f0'] = '2' resp = resp.form.submit('submit') # -> validation page resp = resp.form.submit('submit') # -> submit assert formdef.data_class().select()[0].data['0'] == '2' assert formdef.data_class().select()[0].data['0_display'] == 'world' formdef.data_class().wipe() with mock.patch('qommon.misc.urlopen') as urlopen: data = {'data': [{'id': '1', 'text': 'hello', 'disabled': True}, {'id': '2', 'text': 'world'}]} urlopen.side_effect = lambda *args: StringIO.StringIO(json.dumps(data)) resp = get_app(pub).get('/test/') > assert '' in resp.body E assert '' in '\n\n\nForms - test\n\n\n\n\n\n' E + where '\n\n\nForms - test\n\n\n\n\n\n' = <200 OK text/html body=''/1887>.body tests/test_form_pages.py:4379: AssertionError ____________________________ test_format_mimetypes _____________________________ def test_format_mimetypes(): assert FileTypesDirectory.format_mimetypes(['application/pdf']) == \ 'application/pdf (.pdf)' assert FileTypesDirectory.format_mimetypes(['application/pdf', 'text/rtf']) == \ 'application/pdf (.pdf), text/rtf' > assert FileTypesDirectory.format_mimetypes(['application/pdf', 'application/msword']) == \ 'application/pdf (.pdf), application/msword (.doc)' E AssertionError: assert 'application/...msword (.dot)' == 'application/p...msword (.doc)' E Skipping 37 identical leading characters in diff, use -v to show E - sword (.dot) E ? ^ E + sword (.doc) E ? ^ tests/test_misc.py:70: AssertionError _______________________ test_prefill_formula_time_value ________________________ def test_prefill_formula_time_value(): pub.substitutions.get_context_variables = lambda: {} field = fields.Field() field.prefill = {'type': 'formula', 'value': 'utils.make_datetime("2018-04-04 10:05").time()'} > assert field.get_prefill_value() == ('10:05 a.m.', False) E AssertionError: assert ('10:05', False) == ('10:05 a.m.', False) E At index 0 diff: '10:05' != '10:05 a.m.' E Use -v to get the full diff tests/test_prefill.py:105: AssertionError ----------- generated xml file: /home/chris/src/wcs/test_results.xml ----------- ---------- coverage: platform linux2, python 2.7.13-final-0 ---------- Coverage XML written to file coverage.xml ============= 8 failed, 1383 passed, 20 skipped in 519.41 seconds ============== ERROR: InvocationError: '/tmp/tox-chris/wcs/coverage-py27-django111-pylint-pg/bin/py.test --junit-xml=test_results.xml --cov=wcs --cov-report xml --cov-config .coveragerc tests' ___________________________________ summary ____________________________________ ERROR: coverage-py27-django18-pylint-pg: commands failed ERROR: coverage-py27-django111-pylint-pg: commands failed