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

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jan 28 14:23:26 CET 2009


Author: aurel
Date: Wed Jan 28 14:23:24 2009
New Revision: 25330

URL: http://svn.erp5.org?rev=25330&view=rev
Log:
add a regex and test for a new telephone input case

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=25330&r1=25329&r2=25330&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Telephone.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Telephone.py [utf8] Wed Jan 28 14:23:24 2009
@@ -72,11 +72,11 @@
   # be carefull to add a new regex.
   regex_list = [
     # Country, Area, City, Number, Extension*
-    "\+(?P<country>[\d ]+)(?P<toto>\(0\)|\ |\-)(?P<area>\d+)(\-|\ )(?P<city>\d+)(\-|\ )(?P<number>[\d\ \-]*)(?:\/)?(?P<ext>\d+|)",
+    "\+(?P<country>[\d ]+)(\(0\)|\ |\-)(?P<area>\d+)(\-|\ )(?P<city>\d+)(\-|\ )(?P<number>[\d\ \-]*)(?:\/)?(?P<ext>\d+|)",
 
     # Area, City, Number, Extension*
     "^(\(0\)|0)?(?P<area>\d+)(\-|\ |\/)(?P<city>\d+)(\-|\ )(?P<number>[\d\ \-]*)(?:\/)?(?P<ext>\d+|)",
-
+    "^\+(\(0\)|0)+(?P<area>\d+)(\-|\ |\/)(?P<city>\d+)(\-|\ )(?P<number>[\d\ \-]*)(?:\/)?(?P<ext>\d+|)",
     # Country, Area, Number, Extension*
     # +11(0)1-11111111/111      or +11(0)1-11111111/      or +11(0)1-11111111
     # +11(0)1-1111-1111/111      or +11(0)1-1111-1111/      or +11(0)1-1111-1111

Modified: erp5/trunk/products/ERP5/tests/testERP5Base.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testERP5Base.py?rev=25330&r1=25329&r2=25330&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testERP5Base.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testERP5Base.py [utf8] Wed Jan 28 14:23:24 2009
@@ -933,6 +933,9 @@
       ['+111 11111111/111', '+111(0)-11111111/111'],
       ['+111 11111111/', '+111(0)-11111111'],
       ['+111 11111111', '+111(0)-11111111'],
+      ['+(0)1-1111-1111/111', '+(0)1-1111-1111/111'],
+      ['+(0)1-1111-1111/', '+(0)1-1111-1111'],
+      ['+(0)1-1111-1111', '+(0)1-1111-1111'],
       ['+(0)1-11111111/111', '+(0)1-11111111/111'],
       ['+(0)1-11111111/', '+(0)1-11111111'],
       ['+(0)1-11111111', '+(0)1-11111111'],
@@ -1081,7 +1084,6 @@
 
     for i in input_list:
       tel.fromText(coordinate_text=i[0])
-      print i
       self.assertEquals(i[1],tel.asText())
 
   def test_TelephoneWhenTheDefaultCountryAndAreaPreferenceIsBlank(self):




More information about the Erp5-report mailing list