Commit 4619c632 authored by Jérome Perrin's avatar Jérome Perrin

simple case of a non delegated proxy field value was not tested


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15728 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2b12e939
...@@ -146,6 +146,23 @@ class TestProxyField(unittest.TestCase): ...@@ -146,6 +146,23 @@ class TestProxyField(unittest.TestCase):
self.assert_(proxy_field.is_delegated('title')) self.assert_(proxy_field.is_delegated('title'))
self.assertEquals('Title', proxy_field.get_value('title')) self.assertEquals('Title', proxy_field.get_value('title'))
def test_simple_not_surcharge(self):
self.container.Base_viewProxyFieldLibrary.manage_addField(
'my_title', 'Title', 'StringField')
original_field = self.container.Base_viewProxyFieldLibrary.my_title
self.assertEquals('Title', original_field.get_value('title'))
self.container.Base_view.manage_addField(
'my_title', 'Proxy Title', 'ProxyField')
proxy_field = self.container.Base_view.my_title
proxy_field.manage_edit_xmlrpc(dict(form_id='Base_viewProxyFieldLibrary',
field_id='my_title',))
# XXX no API for this ?
proxy_field._surcharged_edit(dict(title='Proxy Title'), ['title'])
self.failIf(proxy_field.is_delegated('title'))
self.assertEquals('Proxy Title', proxy_field.get_value('title'))
def test_get_value_default(self): def test_get_value_default(self):
# If the proxy field is named 'my_id', it will get 'id' # If the proxy field is named 'my_id', it will get 'id'
# property on the context, regardless of the id of the proxified field # property on the context, regardless of the id of the proxified field
......
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