From 488e5996493637dca7d75f61bfe88f0819f55d81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Fri, 23 Nov 2007 10:32:57 +0000 Subject: [PATCH] Reuse a preference with id erp5_ui_test_preference instead of creating a new one each time git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17760 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../erp5_ui_test/BTZuite_setPreference.xml | 13 +++++++------ .../erp5_ui_test/ListBoxZuite_reset.xml | 5 ++++- bt5/erp5_ui_test/bt/revision | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/BTZuite_setPreference.xml b/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/BTZuite_setPreference.xml index 11dbf07a06..86ffe39d76 100644 --- a/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/BTZuite_setPreference.xml +++ b/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/BTZuite_setPreference.xml @@ -3,11 +3,8 @@ <record id="1" aka="AAAAAAAAAAE="> <pickle> <tuple> - <tuple> - <string>Products.PythonScripts.PythonScript</string> - <string>PythonScript</string> - </tuple> - <none/> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + <tuple/> </tuple> </pickle> <pickle> @@ -74,7 +71,9 @@ if working_copy_list:\n else:\n list = (\'/var/lib/zope/unit_test/svn/bt5\', \'/var/lib/zope/unit_test/Products/ERP5/bootstrap\',)\n \n -pref = context.portal_preferences.newContent()\n +pref = getattr(context.portal_preferences, "erp5_ui_test_preference", None)\n +if pref is None:\n + pref = context.portal_preferences.newContent(id="erp5_ui_test_preference")\n pref.setPreferredSubversionWorkingCopyList(list)\n pref.enable()\n \n @@ -131,7 +130,9 @@ return \'Set Preference Successfully.\'\n <string>tuple</string> <string>_getattr_</string> <string>list</string> + <string>getattr</string> <string>context</string> + <string>None</string> <string>pref</string> </tuple> </value> diff --git a/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/ListBoxZuite_reset.xml b/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/ListBoxZuite_reset.xml index dcbcba1e6f..c828dc52e0 100644 --- a/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/ListBoxZuite_reset.xml +++ b/bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/ListBoxZuite_reset.xml @@ -120,7 +120,9 @@ resetSelection(\'foo_line_selection\')\n resetSelection(\'bar_selection\')\n \n \n -pref = context.portal_preferences.newContent()\n +pref = getattr(context.portal_preferences, "erp5_ui_test_preference", None)\n +if pref is None:\n + pref = context.portal_preferences.newContent(id="erp5_ui_test_preference")\n pref.setPreferredListboxListModeLineCount(10)\n pref.enable()\n \n @@ -184,6 +186,7 @@ return \'Reset Successfully.\'\n <string>result</string> <string>default_columns</string> <string>resetSelection</string> + <string>None</string> <string>pref</string> </tuple> </value> diff --git a/bt5/erp5_ui_test/bt/revision b/bt5/erp5_ui_test/bt/revision index 61f9147fdc..8bc94cb760 100644 --- a/bt5/erp5_ui_test/bt/revision +++ b/bt5/erp5_ui_test/bt/revision @@ -1 +1 @@ -275 \ No newline at end of file +276 \ No newline at end of file -- 2.30.9