[Erp5-report] r21300 - in /erp5/trunk/products/ERP5: Document/ tests/

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jun 3 19:14:55 CEST 2008


Author: rafael
Date: Tue Jun  3 19:14:55 2008
New Revision: 21300

URL: http://svn.erp5.org?rev=21300&view=rev
Log:
Removed "/" if extension does not exist


Modified:
    erp5/trunk/products/ERP5/Document/Telephone.py
    erp5/trunk/products/ERP5/tests/testERP5Base.py

Modified: erp5/trunk/products/ERP5/Document/Telephone.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Telephone.py?rev=21300&r1=21299&r2=21300&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Telephone.py (original)
+++ erp5/trunk/products/ERP5/Document/Telephone.py Tue Jun  3 19:14:55 2008
@@ -401,6 +401,9 @@
         notation=notation.replace('<number>',telephone_number)
         notation=notation.replace('<ext>',telephone_extension)
 
+      if telephone_extension == '':
+        notation=notation.replace('/','')
+
       return notation
 
     security.declareProtected(Permissions.AccessContentsInformation,

Modified: erp5/trunk/products/ERP5/tests/testERP5Base.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testERP5Base.py?rev=21300&r1=21299&r2=21300&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testERP5Base.py (original)
+++ erp5/trunk/products/ERP5/tests/testERP5Base.py Tue Jun  3 19:14:55 2008
@@ -882,71 +882,71 @@
     pref.enable()
     input_list = [
       ["+33(0)2-27224896/999","+33(0)2-27224896/999"],
-      ["+33(0)2-27224896/","+33(0)2-27224896/"],
-      ["+33(0)2-27224896","+33(0)2-27224896/"],
+      ["+33(0)2-27224896/","+33(0)2-27224896"],
+      ["+33(0)2-27224896","+33(0)2-27224896"],
 
       ["+33(0)-5744896/999","+33(0)2-5744896/999"],
-      ["+33(0)-5744896/","+33(0)2-5744896/"],
-      ["+33(0)-5744896","+33(0)2-5744896/"],
+      ["+33(0)-5744896/","+33(0)2-5744896"],
+      ["+33(0)-5744896","+33(0)2-5744896"],
     
       ["+(0)2-27224896/999","+33(0)2-27224896/999"],
-      ["+(0)2-27224896/","+33(0)2-27224896/"],
-      ["+(0)2-27224896","+33(0)2-27224896/"],
+      ["+(0)2-27224896/","+33(0)2-27224896"],
+      ["+(0)2-27224896","+33(0)2-27224896"],
     
       ["+(0)-27224896/999","+33(0)2-27224896/999"],
-      ["+(0)-27224896/","+33(0)2-27224896/"],
-      ["+(0)-27224896","+33(0)2-27224896/"],
+      ["+(0)-27224896/","+33(0)2-27224896"],
+      ["+(0)-27224896","+33(0)2-27224896"],
     
       ["+33(629)024425/222","+33(0)629-024425/222"],
-      ["+33(629)024425/","+33(0)629-024425/"],
-      ["+33(629)024425","+33(0)629-024425/"],
+      ["+33(629)024425/","+33(0)629-024425"],
+      ["+33(629)024425","+33(0)629-024425"],
     
       ["(22)27224897/333","+33(0)22-27224897/333"],
-      ["(22)27224897/","+33(0)22-27224897/"],
-      ["(22)27224897","+33(0)22-27224897/"],
+      ["(22)27224897/","+33(0)22-27224897"],
+      ["(22)27224897","+33(0)22-27224897"],
     
       ["(22)-12345678/222","+33(0)22-12345678/222"],
-      ["(22)-12345678/","+33(0)22-12345678/"],
-      ["(22)-12345678","+33(0)22-12345678/"],
+      ["(22)-12345678/","+33(0)22-12345678"],
+      ["(22)-12345678","+33(0)22-12345678"],
     
       ["+33 2 098765432/1","+33(0)2-098765432/1"],
-      ["+33 2 098765432/","+33(0)2-098765432/"],
-      ["+33 2 098765432","+33(0)2-098765432/"],
+      ["+33 2 098765432/","+33(0)2-098765432"],
+      ["+33 2 098765432","+33(0)2-098765432"],
     
       ["+33 662 1241 1233/999","+33(0)662-12411233/999"],
-      ["+33 662 1241 1233/","+33(0)662-12411233/"],
-      ["+33 662 1241 1233","+33(0)662-12411233/"],
+      ["+33 662 1241 1233/","+33(0)662-12411233"],
+      ["+33 662 1241 1233","+33(0)662-12411233"],
     
       ["6-62 05 76 14/999","+33(0)6-62057614/999"],
-      ["6-62 05 76 14/","+33(0)6-62057614/"],
-      ["6-62 05 76 14","+33(0)6-62057614/"],
+      ["6-62 05 76 14/","+33(0)6-62057614"],
+      ["6-62 05 76 14","+33(0)6-62057614"],
       
       ["62 05 76 14/999","+33(0)2-62057614/999"],
-      ["62 05 76 14/","+33(0)2-62057614/"],
-      ["62 05 76 14","+33(0)2-62057614/"],
+      ["62 05 76 14/","+33(0)2-62057614"],
+      ["62 05 76 14","+33(0)2-62057614"],
     
     
       ["631 22 43/999","+33(0)2-6312243/999"],
-      ["631 22 43/","+33(0)2-6312243/"],
-      ["631 22 43","+33(0)2-6312243/"],
+      ["631 22 43/","+33(0)2-6312243"],
+      ["631 22 43","+33(0)2-6312243"],
     
       ["631-22 43/999","+33(0)631-2243/999"],
-      ["631-22 43/","+33(0)631-2243/"],
-      ["631-22 43","+33(0)631-2243/"],
+      ["631-22 43/","+33(0)631-2243"],
+      ["631-22 43","+33(0)631-2243"],
     
       ["8291212/33","+33(0)2-8291212/33"],
       
       ["047-336-5411/999","+33(0)47-3365411/999"],
-      ["047-336-5411/","+33(0)47-3365411/"],
-      ["047-336-5411","+33(0)47-3365411/"],
+      ["047-336-5411/","+33(0)47-3365411"],
+      ["047-336-5411","+33(0)47-3365411"],
       
       ["047(336)5411/999","+33(0)47-3365411/999"],
-      ["047(336)5411/","+33(0)47-3365411/"],
-      ["047(336)5411","+33(0)47-3365411/"],
+      ["047(336)5411/","+33(0)47-3365411"],
+      ["047(336)5411","+33(0)47-3365411"],
     
       ["+33 662 1244 4112/999","+33(0)662-12444112/999"],
-      ["+33 662 1244 4112/","+33(0)662-12444112/"],
-      ["+33 662 1244 4112","+33(0)662-12444112/"],
+      ["+33 662 1244 4112/","+33(0)662-12444112"],
+      ["+33 662 1244 4112","+33(0)662-12444112"],
     ]
 
     for i in input_list:
@@ -962,79 +962,79 @@
     pref.enable()
     input_list = [
       ["+221(2)27224896/999","+221(2)27224896/999"],
-      ["+221(2)27224896/","+221(2)27224896/"],
-      ["+221(2)27224896","+221(2)27224896/"],
+      ["+221(2)27224896/","+221(2)27224896"],
+      ["+221(2)27224896","+221(2)27224896"],
 
       ["+221()27224896/999","+221()27224896/999"],
-      ["+221()27224896/","+221()27224896/"],
-      ["+221()27224896","+221()27224896/"],
+      ["+221()27224896/","+221()27224896"],
+      ["+221()27224896","+221()27224896"],
  
       ["+221()-27224896/999","+221()27224896/999"],
-      ["+221()-27224896/","+221()27224896/"],
-      ["+221()-27224896","+221()27224896/"],
+      ["+221()-27224896/","+221()27224896"],
+      ["+221()-27224896","+221()27224896"],
     
       ["+(2)27224896/999","+221(2)27224896/999"],
-      ["+(2)27224896/","+221(2)27224896/"],
-      ["+(2)27224896","+221(2)27224896/"],
+      ["+(2)27224896/","+221(2)27224896"],
+      ["+(2)27224896","+221(2)27224896"],
     
       ["+()27224896/999","+221()27224896/999"],
-      ["+()27224896/","+221()27224896/"],
-      ["+()27224896","+221()27224896/"],
+      ["+()27224896/","+221()27224896"],
+      ["+()27224896","+221()27224896"],
     
       ["+221(629)024425/222","+221(629)024425/222"],
-      ["+221(629)024425/","+221(629)024425/"],
-      ["+221(629)024425","+221(629)024425/"],
+      ["+221(629)024425/","+221(629)024425"],
+      ["+221(629)024425","+221(629)024425"],
     
       ["(22)27224897/333","+221(22)27224897/333"],
-      ["(22)27224897/","+221(22)27224897/"],
-      ["(22)27224897","+221(22)27224897/"],
+      ["(22)27224897/","+221(22)27224897"],
+      ["(22)27224897","+221(22)27224897"],
     
       ["(22)-12345678/222","+221(22)12345678/222"],
-      ["(22)-12345678/","+221(22)12345678/"],
-      ["(22)-12345678","+221(22)12345678/"],
+      ["(22)-12345678/","+221(22)12345678"],
+      ["(22)-12345678","+221(22)12345678"],
     
       ["+221 2 098765432/1","+221(2)098765432/1"],
-      ["+221 2 098765432/","+221(2)098765432/"],
-      ["+221 2 098765432","+221(2)098765432/"],
+      ["+221 2 098765432/","+221(2)098765432"],
+      ["+221 2 098765432","+221(2)098765432"],
     
       ["+221 662 1241 1233/999","+221(662)12411233/999"],
-      ["+221 662 1241 1233/","+221(662)12411233/"],
-      ["+221 662 1241 1233","+221(662)12411233/"],
+      ["+221 662 1241 1233/","+221(662)12411233"],
+      ["+221 662 1241 1233","+221(662)12411233"],
     
       ["6-62 05 76 14/999","+221(6)62057614/999"],
-      ["6-62 05 76 14/","+221(6)62057614/"],
-      ["6-62 05 76 14","+221(6)62057614/"],
+      ["6-62 05 76 14/","+221(6)62057614"],
+      ["6-62 05 76 14","+221(6)62057614"],
       
       ["62 05 76 14/999","+221()62057614/999"],
-      ["62 05 76 14/","+221()62057614/"],
-      ["62 05 76 14","+221()62057614/"],
+      ["62 05 76 14/","+221()62057614"],
+      ["62 05 76 14","+221()62057614"],
     
     
       ["631 22 43/999","+221()6312243/999"],
-      ["631 22 43/","+221()6312243/"],
-      ["631 22 43","+221()6312243/"],
+      ["631 22 43/","+221()6312243"],
+      ["631 22 43","+221()6312243"],
     
       ["631-22 43/999","+221(631)2243/999"],
-      ["631-22 43/","+221(631)2243/"],
-      ["631-22 43","+221(631)2243/"],
+      ["631-22 43/","+221(631)2243"],
+      ["631-22 43","+221(631)2243"],
     
       ["8291212/33","+221()8291212/33"],
       
       ["047-336-5411/999","+221(047)3365411/999"],
-      ["047-336-5411/","+221(047)3365411/"],
-      ["047-336-5411","+221(047)3365411/"],
+      ["047-336-5411/","+221(047)3365411"],
+      ["047-336-5411","+221(047)3365411"],
       
       ["047(336)5411/999","+221(047)3365411/999"],
-      ["047(336)5411/","+221(047)3365411/"],
-      ["047(336)5411","+221(047)3365411/"],
+      ["047(336)5411/","+221(047)3365411"],
+      ["047(336)5411","+221(047)3365411"],
     
       ["+221 662 1244 4112/999","+221(662)12444112/999"],
-      ["+221 662 1244 4112/","+221(662)12444112/"],
-      ["+221 662 1244 4112","+221(662)12444112/"],  
+      ["+221 662 1244 4112/","+221(662)12444112"],
+      ["+221 662 1244 4112","+221(662)12444112"],  
  
       ["+221-047-12345678/990","+221(047)12345678/990"],
-      ["+221-047-12345678/","+221(047)12345678/"],
-      ["+221-047-12345678","+221(047)12345678/"]
+      ["+221-047-12345678/","+221(047)12345678"],
+      ["+221-047-12345678","+221(047)12345678"]
     ]
 
     for i in input_list:
@@ -1051,82 +1051,81 @@
     pref.enable()
     input_list = [
       ["+55(2)27224896/999","+55(2)27224896/999"],
-      ["+55(2)27224896/","+55(2)27224896/"],
-      ["+55(2)27224896","+55(2)27224896/"],
+      ["+55(2)27224896/","+55(2)27224896"],
+      ["+55(2)27224896","+55(2)27224896"],
 
       ["+55()27224896/999","+55(2)27224896/999"],
-      ["+55()27224896/","+55(2)27224896/"],
-      ["+55()27224896","+55(2)27224896/"],
+      ["+55()27224896/","+55(2)27224896"],
+      ["+55()27224896","+55(2)27224896"],
  
       ["+55()-27224896/999","+55(2)27224896/999"],
-      ["+55()-27224896/","+55(2)27224896/"],
-      ["+55()-27224896","+55(2)27224896/"],
+      ["+55()-27224896/","+55(2)27224896"],
+      ["+55()-27224896","+55(2)27224896"],
     
       ["+(2)27224896/999","+55(2)27224896/999"],
-      ["+(2)27224896/","+55(2)27224896/"],
-      ["+(2)27224896","+55(2)27224896/"],
+      ["+(2)27224896/","+55(2)27224896"],
+      ["+(2)27224896","+55(2)27224896"],
     
       ["+()27224896/999","+55(2)27224896/999"],
-      ["+()27224896/","+55(2)27224896/"],
-      ["+()27224896","+55(2)27224896/"],
+      ["+()27224896/","+55(2)27224896"],
+      ["+()27224896","+55(2)27224896"],
     
       ["+55(629)024425/222","+55(629)024425/222"],
-      ["+55(629)024425/","+55(629)024425/"],
-      ["+55(629)024425","+55(629)024425/"],
+      ["+55(629)024425/","+55(629)024425"],
+      ["+55(629)024425","+55(629)024425"],
     
       ["(22)27224897/333","+55(22)27224897/333"],
-      ["(22)27224897/","+55(22)27224897/"],
-      ["(22)27224897","+55(22)27224897/"],
+      ["(22)27224897/","+55(22)27224897"],
+      ["(22)27224897","+55(22)27224897"],
     
       ["(22)-12345678/222","+55(22)12345678/222"],
-      ["(22)-12345678/","+55(22)12345678/"],
-      ["(22)-12345678","+55(22)12345678/"],
+      ["(22)-12345678/","+55(22)12345678"],
+      ["(22)-12345678","+55(22)12345678"],
     
       ["+55 2 098765432/1","+55(2)098765432/1"],
-      ["+55 2 098765432/","+55(2)098765432/"],
-      ["+55 2 098765432","+55(2)098765432/"],
+      ["+55 2 098765432/","+55(2)098765432"],
+      ["+55 2 098765432","+55(2)098765432"],
     
       ["+55 662 1241 1233/999","+55(662)12411233/999"],
-      ["+55 662 1241 1233/","+55(662)12411233/"],
-      ["+55 662 1241 1233","+55(662)12411233/"],
+      ["+55 662 1241 1233/","+55(662)12411233"],
+      ["+55 662 1241 1233","+55(662)12411233"],
     
       ["6-62 05 76 14/999","+55(6)62057614/999"],
-      ["6-62 05 76 14/","+55(6)62057614/"],
-      ["6-62 05 76 14","+55(6)62057614/"],
+      ["6-62 05 76 14/","+55(6)62057614"],
+      ["6-62 05 76 14","+55(6)62057614"],
       
       ["62 05 76 14/999","+55(2)62057614/999"],
-      ["62 05 76 14/","+55(2)62057614/"],
-      ["62 05 76 14","+55(2)62057614/"],
+      ["62 05 76 14/","+55(2)62057614"],
+      ["62 05 76 14","+55(2)62057614"],
     
     
       ["631 22 43/999","+55(2)6312243/999"],
-      ["631 22 43/","+55(2)6312243/"],
-      ["631 22 43","+55(2)6312243/"],
+      ["631 22 43/","+55(2)6312243"],
+      ["631 22 43","+55(2)6312243"],
     
       ["631-22 43/999","+55(631)2243/999"],
-      ["631-22 43/","+55(631)2243/"],
-      ["631-22 43","+55(631)2243/"],
+      ["631-22 43/","+55(631)2243"],
+      ["631-22 43","+55(631)2243"],
     
       ["8291212/33","+55(2)8291212/33"],
       
       ["047-336-5411/999","+55(047)3365411/999"],
-      ["047-336-5411/","+55(047)3365411/"],
-      ["047-336-5411","+55(047)3365411/"],
+      ["047-336-5411/","+55(047)3365411"],
+      ["047-336-5411","+55(047)3365411"],
       
       ["047(336)5411/999","+55(047)3365411/999"],
-      ["047(336)5411/","+55(047)3365411/"],
-      ["047(336)5411","+55(047)3365411/"],
+      ["047(336)5411/","+55(047)3365411"],
+      ["047(336)5411","+55(047)3365411"],
     
       ["+55 662 1244 4112/999","+55(662)12444112/999"],
-      ["+55 662 1244 4112/","+55(662)12444112/"],
-      ["+55 662 1244 4112","+55(662)12444112/"],  
+      ["+55 662 1244 4112/","+55(662)12444112"],
+      ["+55 662 1244 4112","+55(662)12444112"],  
  
       ["+55-047-12345678/990","+55(047)12345678/990"],
-      ["+55-047-12345678/","+55(047)12345678/"],
-      ["+55-047-12345678","+55(047)12345678/"]
+      ["+55-047-12345678/","+55(047)12345678"],
+      ["+55-047-12345678","+55(047)12345678"]
     ]
 
-    # To help with debug,
     for i in input_list:
       tel.fromText(coordinate_text=i[0])
       self.assertEquals(i[1],tel.asText())
@@ -1140,71 +1139,71 @@
     pref.enable()
     input_list = [
       ["+81(2)27224896/999","+81(2)27224896/999"],
-      ["+81(2)27224896/","+81(2)27224896/"],
-      ["+81(2)27224896","+81(2)27224896/"],
+      ["+81(2)27224896/","+81(2)27224896"],
+      ["+81(2)27224896","+81(2)27224896"],
     
       ["+(2)27224896/999","+81(2)27224896/999"],
-      ["+(2)27224896/","+81(2)27224896/"],
-      ["+(2)27224896","+81(2)27224896/"],
+      ["+(2)27224896/","+81(2)27224896"],
+      ["+(2)27224896","+81(2)27224896"],
     
       ["+()27224896/999","+81(2)27224896/999"],
-      ["+()27224896/","+81(2)27224896/"],
-      ["+()27224896","+81(2)27224896/"],
+      ["+()27224896/","+81(2)27224896"],
+      ["+()27224896","+81(2)27224896"],
     
       ["+81(629)024425/222","+81(629)024425/222"],
-      ["+81(629)024425/","+81(629)024425/"],
-      ["+81(629)024425","+81(629)024425/"],
+      ["+81(629)024425/","+81(629)024425"],
+      ["+81(629)024425","+81(629)024425"],
     
       ["(22)27224897/333","+81(22)27224897/333"],
-      ["(22)27224897/","+81(22)27224897/"],
-      ["(22)27224897","+81(22)27224897/"],
+      ["(22)27224897/","+81(22)27224897"],
+      ["(22)27224897","+81(22)27224897"],
     
       ["(22)-12345678/222","+81(22)12345678/222"],
-      ["(22)-12345678/","+81(22)12345678/"],
-      ["(22)-12345678","+81(22)12345678/"],
+      ["(22)-12345678/","+81(22)12345678"],
+      ["(22)-12345678","+81(22)12345678"],
     
       ["+81 2 098765432/1","+81(2)098765432/1"],
-      ["+81 2 098765432/","+81(2)098765432/"],
-      ["+81 2 098765432","+81(2)098765432/"],
+      ["+81 2 098765432/","+81(2)098765432"],
+      ["+81 2 098765432","+81(2)098765432"],
     
       ["+81 662 1241 1233/999","+81(662)12411233/999"],
-      ["+81 662 1241 1233/","+81(662)12411233/"],
-      ["+81 662 1241 1233","+81(662)12411233/"],
+      ["+81 662 1241 1233/","+81(662)12411233"],
+      ["+81 662 1241 1233","+81(662)12411233"],
     
       ["6-62 05 76 14/999","+81(6)62057614/999"],
-      ["6-62 05 76 14/","+81(6)62057614/"],
-      ["6-62 05 76 14","+81(6)62057614/"],
+      ["6-62 05 76 14/","+81(6)62057614"],
+      ["6-62 05 76 14","+81(6)62057614"],
       
       ["62 05 76 14/999","+81(2)62057614/999"],
-      ["62 05 76 14/","+81(2)62057614/"],
-      ["62 05 76 14","+81(2)62057614/"],
+      ["62 05 76 14/","+81(2)62057614"],
+      ["62 05 76 14","+81(2)62057614"],
     
     
       ["631 22 43/999","+81(2)6312243/999"],
-      ["631 22 43/","+81(2)6312243/"],
-      ["631 22 43","+81(2)6312243/"],
+      ["631 22 43/","+81(2)6312243"],
+      ["631 22 43","+81(2)6312243"],
     
       ["631-22 43/999","+81(631)2243/999"],
-      ["631-22 43/","+81(631)2243/"],
-      ["631-22 43","+81(631)2243/"],
+      ["631-22 43/","+81(631)2243"],
+      ["631-22 43","+81(631)2243"],
     
       ["8291212/33","+81(2)8291212/33"],
       
       ["047-336-5411/999","+81(047)3365411/999"],
-      ["047-336-5411/","+81(047)3365411/"],
-      ["047-336-5411","+81(047)3365411/"],
+      ["047-336-5411/","+81(047)3365411"],
+      ["047-336-5411","+81(047)3365411"],
       
       ["047(336)5411/999","+81(047)3365411/999"],
-      ["047(336)5411/","+81(047)3365411/"],
-      ["047(336)5411","+81(047)3365411/"],
+      ["047(336)5411/","+81(047)3365411"],
+      ["047(336)5411","+81(047)3365411"],
     
       ["+81 662 1244 4112/999","+81(662)12444112/999"],
-      ["+81 662 1244 4112/","+81(662)12444112/"],
-      ["+81 662 1244 4112","+81(662)12444112/"],  
+      ["+81 662 1244 4112/","+81(662)12444112"],
+      ["+81 662 1244 4112","+81(662)12444112"],  
  
       ["+81-047-12345678/990","+81(047)12345678/990"],
-      ["+81-047-12345678/","+81(047)12345678/"],
-      ["+81-047-12345678","+81(047)12345678/"]
+      ["+81-047-12345678/","+81(047)12345678"],
+      ["+81-047-12345678","+81(047)12345678"]
     ]
 
     for i in input_list:
@@ -1215,7 +1214,7 @@
     pers = self.getPersonModule().newContent(portal_type='Person')
     tel = pers.newContent(portal_type='Telephone')
     tel.fromText(coordinate_text='12345678')
-    self.assertEquals('+(0)-12345678/',tel.asText())
+    self.assertEquals('+(0)-12345678',tel.asText())
 
   def test_TelephoneAsTextBlankNumber(self):
     # Test asText method with blank number




More information about the Erp5-report mailing list