Commit 5a341f5a authored by Ivan Tyagov's avatar Ivan Tyagov

Play as well with existing preferences left from previous tests (especially...

Play as well with existing preferences left from previous tests (especially with user levelpreferences created from accounting tests)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39025 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2f504bbd
...@@ -55,12 +55,10 @@ ...@@ -55,12 +55,10 @@
# Setup System Preference\n # Setup System Preference\n
dms_system_preference_id = \'dms_system_preference_ui_tests\'\n dms_system_preference_id = \'dms_system_preference_ui_tests\'\n
portal_preferences = context.portal_preferences\n portal_preferences = context.portal_preferences\n
if dms_system_preference_id not in portal_preferences.objectIds():\n dms_preference = portal_preferences.getActiveSystemPreference()\n
if dms_preference is None:\n
dms_preference = portal_preferences.newContent(id = dms_system_preference_id,\n dms_preference = portal_preferences.newContent(id = dms_system_preference_id,\n
portal_type = \'System Preference\')\n portal_type = \'System Preference\')\n
else:\n
dms_preference = getattr(portal_preferences, dms_system_preference_id)\n
\n
kw = dict(priority = 1,\n kw = dict(priority = 1,\n
preferred_document_reference_regular_expression = \'(?P<reference>[a-zA-Z0-9-_.]+-[a-zA-Z0-9-_.]+)(|-(?P<version>[0-9a-zA-Z.]+))(|-(?P<language>[a-z]{2})[^-]*)?\',\n preferred_document_reference_regular_expression = \'(?P<reference>[a-zA-Z0-9-_.]+-[a-zA-Z0-9-_.]+)(|-(?P<version>[0-9a-zA-Z.]+))(|-(?P<language>[a-z]{2})[^-]*)?\',\n
preferred_document_file_name_regular_expression = \'(?P<node_reference>[a-zA-Z0-9_-]+)-(?P<local_reference>[a-zA-Z0-9_.]+)-(?P<version>[0-9a-zA-Z.]+)-(?P<language>[a-z]{2})[^-]*?\',\n preferred_document_file_name_regular_expression = \'(?P<node_reference>[a-zA-Z0-9_-]+)-(?P<local_reference>[a-zA-Z0-9_.]+)-(?P<version>[0-9a-zA-Z.]+)-(?P<language>[a-z]{2})[^-]*?\',\n
...@@ -69,22 +67,21 @@ kw = dict(priority = 1,\n ...@@ -69,22 +67,21 @@ kw = dict(priority = 1,\n
preferred_ooodoc_server_address = \'localhost\',\n preferred_ooodoc_server_address = \'localhost\',\n
preferred_ooodoc_server_port_number = 8008)\n preferred_ooodoc_server_port_number = 8008)\n
dms_preference.edit(**kw)\n dms_preference.edit(**kw)\n
if dms_preference.getPreferenceState()!=\'global\':\n if dms_preference.getPreferenceState()==\'disabled\':\n
dms_preference.enable()\n dms_preference.enable()\n
\n \n
# Setup Preference so we can setup Access Tab\n # Setup Preference so we can setup Access Tab\n
dms_preference_id = \'dms_preference_ui_tests\'\n dms_preference_id = \'dms_preference_ui_tests\'\n
if dms_preference_id not in portal_preferences.objectIds():\n dms_preference = portal_preferences.getActivePreference()\n
if dms_preference is None:\n
dms_preference = portal_preferences.newContent(\n dms_preference = portal_preferences.newContent(\n
id = dms_preference_id,\n id = dms_preference_id,\n
portal_type = \'Preference\')\n portal_type = \'Preference\')\n
else:\n
dms_preference = getattr(portal_preferences, dms_preference_id)\n
kw=dict(priority = 1,\n kw=dict(priority = 1,\n
preferred_html_style_access_tab=1,\n preferred_html_style_access_tab=1,\n
preferred_listbox_list_mode_line_count=10)\n preferred_listbox_list_mode_line_count=10)\n
dms_preference.edit(**kw)\n dms_preference.edit(**kw)\n
if dms_preference.getPreferenceState()!=\'global\':\n if dms_preference.getPreferenceState()==\'disabled\':\n
dms_preference.enable()\n dms_preference.enable()\n
\n \n
# Publish all knowledge pad gadgets\n # Publish all knowledge pad gadgets\n
...@@ -148,7 +145,7 @@ return printed\n ...@@ -148,7 +145,7 @@ return printed\n
<string>context</string> <string>context</string>
<string>portal_preferences</string> <string>portal_preferences</string>
<string>dms_preference</string> <string>dms_preference</string>
<string>getattr</string> <string>None</string>
<string>dict</string> <string>dict</string>
<string>True</string> <string>True</string>
<string>kw</string> <string>kw</string>
......
...@@ -51,9 +51,9 @@ ...@@ -51,9 +51,9 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string># Delete System Preference\n <value> <string># Delete System Preference\n
portal_preferences = context.portal_preferences\n #portal_preferences = context.portal_preferences\n
portal_preferences.manage_delObjects([\'dms_system_preference_ui_tests\', \'dms_preference_ui_tests\'])\n #portal_preferences.manage_delObjects([\'dms_system_preference_ui_tests\', \'dms_preference_ui_tests\'])\n
context.portal_caches.clearAllCache()\n #context.portal_caches.clearAllCache()\n
print "Done"\n print "Done"\n
return printed\n return printed\n
</string> </value> </string> </value>
...@@ -102,9 +102,6 @@ return printed\n ...@@ -102,9 +102,6 @@ return printed\n
<tuple> <tuple>
<string>_print_</string> <string>_print_</string>
<string>_print</string> <string>_print</string>
<string>_getattr_</string>
<string>context</string>
<string>portal_preferences</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
16 17
\ 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