From 8341aa8c1e9c05a07479477271a5e6daae0b6ad1 Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Fri, 19 Nov 2010 12:52:58 +0000
Subject: [PATCH] more pricise assertion using regexp.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40412 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../document_zuite/testAddObject.xml          | 24 +++++++++----------
 .../document_zuite/testCloneObject.xml        | 17 +++++++------
 ...viousNextButtonsDoesNotKeepBogusFormId.xml | 20 ++++++++--------
 .../testRelationFieldJump.xml                 | 15 +++++++-----
 .../testSimpleRelationFieldSaveButton.xml     | 20 ++++++++--------
 bt5/erp5_ui_test/bt/revision                  |  2 +-
 6 files changed, 52 insertions(+), 46 deletions(-)

diff --git a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/document_zuite/testAddObject.xml b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/document_zuite/testAddObject.xml
index 26d34386dc..91e092e483 100644
--- a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/document_zuite/testAddObject.xml
+++ b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/document_zuite/testAddObject.xml
@@ -2,10 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <tuple>
-        <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
-        <tuple/>
-      </tuple>
+      <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -37,7 +34,7 @@
         </item>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string encoding="cdata"><![CDATA[
+            <value> <unicode encoding="cdata"><![CDATA[
 
 <html xmlns:tal="http://xml.zope.org/namespaces/tal"\n
       xmlns:metal="http://xml.zope.org/namespaces/metal">\n
@@ -67,7 +64,7 @@
 have id "2". This is probably a bit too stupid. -->\n
 <tr>\n
   <td>assertAbsoluteLocation</td>\n
-  <td tal:content="string:glob:${here/portal_url}/foo_module/2*" />\n
+  <td tal:content="string:regexp:${here/portal_url}/foo_module/2(\\?|$$)" />\n
   <td></td>\n
 </tr>\n
 <tr>\n
@@ -88,7 +85,7 @@ have id "2". This is probably a bit too stupid. -->\n
 </tr>\n
 <tr>\n
   <td>assertAbsoluteLocation</td>\n
-  <td tal:content="string:glob:${here/portal_url}/foo_module/2/1*" />\n
+  <td tal:content="string:regexp:${here/portal_url}/foo_module/2/1(\\?|$$)" />\n
   <td></td>\n
 </tr>\n
 <tr>\n
@@ -116,7 +113,7 @@ have id "2". This is probably a bit too stupid. -->\n
 </tr>\n
 <tr>\n
   <td>assertAbsoluteLocation</td>\n
-  <td tal:content="string:glob:${here/portal_url}/foo_module/3*" />\n
+  <td tal:content="string:regexp:${here/portal_url}/foo_module/3(\\?|$$)" />\n
   <td></td>\n
 </tr>\n
 <tr>\n
@@ -153,10 +150,9 @@ another object of the same type. -->\n
 </tr>\n
 \n
 </body>\n
-</html>\n
+</html>
 
-
-]]></string> </value>
+]]></unicode> </value>
         </item>
         <item>
             <key> <string>content_type</string> </key>
@@ -170,9 +166,13 @@ another object of the same type. -->\n
             <key> <string>id</string> </key>
             <value> <string>testAddObject</string> </value>
         </item>
+        <item>
+            <key> <string>output_encoding</string> </key>
+            <value> <string>utf-8</string> </value>
+        </item>
         <item>
             <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <value> <unicode></unicode> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/document_zuite/testCloneObject.xml b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/document_zuite/testCloneObject.xml
index a146e2c426..0ebba8e428 100644
--- a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/document_zuite/testCloneObject.xml
+++ b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/document_zuite/testCloneObject.xml
@@ -34,7 +34,7 @@
         </item>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string encoding="cdata"><![CDATA[
+            <value> <unicode encoding="cdata"><![CDATA[
 
 <html xmlns:tal="http://xml.zope.org/namespaces/tal"\n
       xmlns:metal="http://xml.zope.org/namespaces/metal">\n
@@ -64,7 +64,7 @@
 have id "2". This is probably a bit too stupid. -->\n
 <tr>\n
   <td>assertAbsoluteLocation</td>\n
-  <td tal:content="string:glob:${here/portal_url}/foo_module/2*" />\n
+  <td tal:content="string:regexp:${here/portal_url}/foo_module/2(\\?|$$)" />\n
   <td></td>\n
 </tr>\n
 <tr>\n
@@ -85,7 +85,7 @@ have id "2". This is probably a bit too stupid. -->\n
 </tr>\n
 <tr>\n
   <td>assertAbsoluteLocation</td>\n
-  <td tal:content="string:glob:${here/portal_url}/foo_module/2/1*" />\n
+  <td tal:content="string:regexp:${here/portal_url}/foo_module/2/1(\\?|$$)" />\n
   <td></td>\n
 </tr>\n
 <tr>\n
@@ -167,10 +167,9 @@ another object of the same type. -->\n
   <td tal:content="string:regexp:Object copied from /.*/foo_module/2$$"/>\n
 </tr>\n
 </body>\n
-</html>\n
+</html>
 
-
-]]></string> </value>
+]]></unicode> </value>
         </item>
         <item>
             <key> <string>content_type</string> </key>
@@ -184,9 +183,13 @@ another object of the same type. -->\n
             <key> <string>id</string> </key>
             <value> <string>testCloneObject</string> </value>
         </item>
+        <item>
+            <key> <string>output_encoding</string> </key>
+            <value> <string>utf-8</string> </value>
+        </item>
         <item>
             <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <value> <unicode></unicode> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/document_zuite/testSelectionPreviousNextButtonsDoesNotKeepBogusFormId.xml b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/document_zuite/testSelectionPreviousNextButtonsDoesNotKeepBogusFormId.xml
index acb1ea649a..c09ab91368 100644
--- a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/document_zuite/testSelectionPreviousNextButtonsDoesNotKeepBogusFormId.xml
+++ b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/document_zuite/testSelectionPreviousNextButtonsDoesNotKeepBogusFormId.xml
@@ -2,10 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <tuple>
-        <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
-        <tuple/>
-      </tuple>
+      <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -37,7 +34,7 @@
         </item>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string encoding="cdata"><![CDATA[
+            <value> <unicode encoding="cdata"><![CDATA[
 
 <html xmlns:tal="http://xml.zope.org/namespaces/tal"\n
       xmlns:metal="http://xml.zope.org/namespaces/metal">\n
@@ -95,16 +92,15 @@ does not keep bogus `form_id`.</td></tr>\n
 </tr>\n
 <tr>\n
   <td>assertAbsoluteLocation</td>\n
-  <td tal:content="string:glob:${here/portal_url}/foo_bar_module/bar_0*" />\n
+  <td tal:content="string:regexp:${here/portal_url}/foo_bar_module/bar_0(\\?|$$)" />\n
   <td></td>\n
 </tr>\n
 \n
 </tbody></table>\n
 </body>\n
-</html>\n
+</html>
 
-
-]]></string> </value>
+]]></unicode> </value>
         </item>
         <item>
             <key> <string>content_type</string> </key>
@@ -118,9 +114,13 @@ does not keep bogus `form_id`.</td></tr>\n
             <key> <string>id</string> </key>
             <value> <string>testSelectionPreviousNextButtonsDoesNotKeepBogusFormId</string> </value>
         </item>
+        <item>
+            <key> <string>output_encoding</string> </key>
+            <value> <string>utf-8</string> </value>
+        </item>
         <item>
             <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <value> <unicode></unicode> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/relation_field_zuite/testRelationFieldJump.xml b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/relation_field_zuite/testRelationFieldJump.xml
index b6f26e7edb..defcb184ab 100644
--- a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/relation_field_zuite/testRelationFieldJump.xml
+++ b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/relation_field_zuite/testRelationFieldJump.xml
@@ -34,7 +34,7 @@
         </item>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string encoding="cdata"><![CDATA[
+            <value> <unicode encoding="cdata"><![CDATA[
 
 <html xmlns:tal="http://xml.zope.org/namespaces/tal"\n
       xmlns:metal="http://xml.zope.org/namespaces/metal">\n
@@ -176,7 +176,7 @@ will be shown\n
 </tr>\n
 <tr>\n
   <td>assertAbsoluteLocation</td>\n
-  <td tal:content="string:glob:${here/portal_url}/foo_module/1*"/>\n
+  <td tal:content="string:regexp:${here/portal_url}/foo_module/1(\\?|$$)"/>\n
   <td></td>\n
   <td></td>\n
 </tr>\n
@@ -220,10 +220,9 @@ will be shown\n
 </tr>\n
 </tbody></table>\n
 </body>\n
-</html>\n
+</html>
 
-
-]]></string> </value>
+]]></unicode> </value>
         </item>
         <item>
             <key> <string>content_type</string> </key>
@@ -237,9 +236,13 @@ will be shown\n
             <key> <string>id</string> </key>
             <value> <string>testRelationFieldJump</string> </value>
         </item>
+        <item>
+            <key> <string>output_encoding</string> </key>
+            <value> <string>utf-8</string> </value>
+        </item>
         <item>
             <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <value> <unicode></unicode> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/relation_field_zuite/testSimpleRelationFieldSaveButton.xml b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/relation_field_zuite/testSimpleRelationFieldSaveButton.xml
index 9ed246a464..5dd40680f0 100644
--- a/bt5/erp5_ui_test/PathTemplateItem/portal_tests/relation_field_zuite/testSimpleRelationFieldSaveButton.xml
+++ b/bt5/erp5_ui_test/PathTemplateItem/portal_tests/relation_field_zuite/testSimpleRelationFieldSaveButton.xml
@@ -2,10 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <tuple>
-        <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
-        <tuple/>
-      </tuple>
+      <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -37,7 +34,7 @@
         </item>
         <item>
             <key> <string>_text</string> </key>
-            <value> <string encoding="cdata"><![CDATA[
+            <value> <unicode encoding="cdata"><![CDATA[
 
 <html xmlns:tal="http://xml.zope.org/namespaces/tal"\n
       xmlns:metal="http://xml.zope.org/namespaces/metal">\n
@@ -119,15 +116,14 @@ button</td></tr>\n
 </tr>\n
 <tr>\n
   <td>assertAbsoluteLocation</td>\n
-  <td tal:content="string:glob:${here/portal_url}/portal_categories/foo_category/a/a1*" />\n
+  <td tal:content="string:regexp:${here/portal_url}/portal_categories/foo_category/a/a1(\\?|$$)" />\n
   <td/>\n
 </tr>\n
 </tbody></table>\n
 </body>\n
-</html>\n
+</html>
 
-
-]]></string> </value>
+]]></unicode> </value>
         </item>
         <item>
             <key> <string>content_type</string> </key>
@@ -141,9 +137,13 @@ button</td></tr>\n
             <key> <string>id</string> </key>
             <value> <string>testSimpleRelationFieldSaveButton</string> </value>
         </item>
+        <item>
+            <key> <string>output_encoding</string> </key>
+            <value> <string>utf-8</string> </value>
+        </item>
         <item>
             <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <value> <unicode></unicode> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_ui_test/bt/revision b/bt5/erp5_ui_test/bt/revision
index 748e6f1af5..a869e998c0 100644
--- a/bt5/erp5_ui_test/bt/revision
+++ b/bt5/erp5_ui_test/bt/revision
@@ -1 +1 @@
-637
\ No newline at end of file
+638
\ No newline at end of file
-- 
2.30.9