From 4619c632b5794b90b734232e320acb8f586c424c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Fri, 17 Aug 2007 13:05:06 +0000 Subject: [PATCH] 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 --- product/ERP5Form/tests/testFields.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/product/ERP5Form/tests/testFields.py b/product/ERP5Form/tests/testFields.py index 01e12ed435..540a9763b1 100644 --- a/product/ERP5Form/tests/testFields.py +++ b/product/ERP5Form/tests/testFields.py @@ -146,6 +146,23 @@ class TestProxyField(unittest.TestCase): self.assert_(proxy_field.is_delegated('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): # If the proxy field is named 'my_id', it will get 'id' # property on the context, regardless of the id of the proxified field -- 2.30.9