Commit 91afdf4f authored by Jérome Perrin's avatar Jérome Perrin

reset selections before running tests.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10992 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c000de73
...@@ -76,7 +76,6 @@ ...@@ -76,7 +76,6 @@
\n \n
# enable preference\n # enable preference\n
pref = portal.portal_preferences.accounting_zuite_preference\n pref = portal.portal_preferences.accounting_zuite_preference\n
\n
if pref.owner_info()[\'id\'] != str(context.REQUEST.AUTHENTICATED_USER):\n if pref.owner_info()[\'id\'] != str(context.REQUEST.AUTHENTICATED_USER):\n
# we have to \'own\' the preference for the test\n # we have to \'own\' the preference for the test\n
ptool = portal.portal_preferences\n ptool = portal.portal_preferences\n
...@@ -86,9 +85,19 @@ if pref.owner_info()[\'id\'] != str(context.REQUEST.AUTHENTICATED_USER):\n ...@@ -86,9 +85,19 @@ if pref.owner_info()[\'id\'] != str(context.REQUEST.AUTHENTICATED_USER):\n
# as the preference changed, it\'s safer to clear the cache\n # as the preference changed, it\'s safer to clear the cache\n
from Products.ERP5Type.Cache import clearCache\n from Products.ERP5Type.Cache import clearCache\n
clearCache()\n clearCache()\n
\n
pref.enable()\n pref.enable()\n
\n \n
# reset selections\n
stool = context.getPortalObject().portal_selections\n
for form in context.getPortalObject().portal_skins\\\n
.erp5_accounting.objectValues(spec=(\'ERP5 Form\',)):\n
listbox = getattr(form, \'listbox\', None)\n
if listbox is not None:\n
stool.setSelectionFor(listbox.get_value(\'selection_name\'), None)\n
# also reset common selections\n
stool.setSelectionFor(\'person_selection\', None)\n
stool.setSelectionFor(\'organisation_selection\', None)\n
\n
return "Reset Successfully."\n return "Reset Successfully."\n
</string> </value> </string> </value>
</item> </item>
...@@ -146,6 +155,11 @@ return "Reset Successfully."\n ...@@ -146,6 +155,11 @@ return "Reset Successfully."\n
<string>cb</string> <string>cb</string>
<string>Products.ERP5Type.Cache</string> <string>Products.ERP5Type.Cache</string>
<string>clearCache</string> <string>clearCache</string>
<string>stool</string>
<string>form</string>
<string>getattr</string>
<string>None</string>
<string>listbox</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
28 29
\ No newline at end of file \ No newline at end of file
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