Commit c50af870 authored by Nicolas Dumazet's avatar Nicolas Dumazet

add test for bug #1443

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34350 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0781683f
master 20240125SubscriptionItemVariousImprovement 20240125variousimprovement 20240227variousimprovement 20240618jumpandthreadreaderattachment 20240618variousimprovements 20241023 Base_reindexAndSenseAlarm acquiredpermissionfield assignmentlist asyncscannerjs bugapp closing_assignment constraintontemplate directcloneaction disablexhtmlstyle domparsererror droplimit1000 erp5_drone_simulator erp5css20160715 erp5css20160728 erp5jsaccesspage erp5jsformboxcss erp5jsgit erp5jsmoduletitleheader erp5jsonlyjump erp5jsslideshowdelete feat/zeleniumstopontimeout fieldvalidationerrorlabeltext fix/callableid fixup_upgrade__code__ fixuperp5jsdelete fixuptypejavascript for_testrunner_2 form_list_on_access_page forumlinebreak halimprovement halnoneurlcolumn hateoas_http_cache hyperlink increase_max_age interaction interfront jabapp jm/form-action-guard js_style jsstyledialog logcompatibility matrixboxjs methoddraw multipledomainvalues new-api-master-client officejs-sdk olapi olapy20190301 olapy20190417 openorderstopdate oula parallellistfield patch-1 randomdistribute refresh relation_field_read_only rjsstate20161102 samesite samesitelax scannerbrowsercompatibilityfixup searchrank serviceworker slideeditor slideshowviewer squash stabilize_osr_tests supplylinkdefaultlink testperformance testxhtml_brokenproxyfield tooltitle use_erp5_core_test variousimprovement variouswebimprovement webjs20230216 webjsdoublereference webjsfailingfailovercss webjsstyleeffectivedate webjsstylefeed webjsstyleimgdownload webjsstylelanguage wip wip-vifib wip20160316 wip20170905 wip20170906 wip20180702 wip20180816 wip20181115_erp5_access_token_hal wip20190620 wiprugby erp5.util-0.4.44 erp5.util-0.4.43 erp5.util-0.4.41 erp5.util-0.4.40 erp5.util-0.4.37 erp5.util-0.4.1 erp5.util-0.4 erp5.util-0.3 erp5.util-0.2 erp5.util-0.1
No related merge requests found
......@@ -42,6 +42,7 @@ from ZPublisher.HTTPRequest import FileUpload
from StringIO import StringIO
from Products.ERP5Form.Selection import Selection
from Products.ERP5Form.Form import ERP5Form
from Products.Formulator.TALESField import TALESMethod
class DummyFieldStorage:
......@@ -297,6 +298,45 @@ return []
# Make sure that word is there
self.assertEqual(rendered_listbox.find(word) > 0, True)
def testCellKeywordInProxifiedListboxColumn(self):
"""
Test that cell keyword is correctly interpreted when used in TALES
to render a cell of a ListBox.
First use cell in the ProxyField context, then use it in the listbox_xxx
context
"""
portal = self.getPortal()
portal.ListBoxZuite_reset()
form = portal.Foo_viewListBoxProxyField
portal.foo_module.FooModule_createObjects()
here = portal.foo_module['0']
here.Foo_createObjects()
request = get_request()
request['here'] = here
transaction.commit()
listbox_title_column = form.listbox_title
self.assertTrue(listbox_title_column.is_delegated('default'))
self.assertEquals(listbox_title_column.get_recursive_tales('default')._text,
'python: cell.getTitle()')
listboxline_list = form.listbox.get_value('default', render_format = 'list',
REQUEST = request)
first_item = dict(listboxline_list[1].getColumnItemList())
self.assertEquals(first_item['title'], 'Title 0')
# Use "cell" locally
listbox_title_column.manage_tales_surcharged_xmlrpc(
dict(default=TALESMethod('python: cell.getTitle() + " local"')))
listboxline_list = form.listbox.get_value('default', render_format = 'list',
REQUEST = request)
first_item = dict(listboxline_list[1].getColumnItemList())
self.assertEquals(first_item['title'], 'Title 0 local')
def _helperExtraAndCssInListboxLine(self, field_type, editable):
"""
Create a listbox_xxx field, in the hidden group, that defines
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment