[Erp5-report] r20050 - /erp5/trunk/products/ERP5/tests/testERP5Base.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Mar 19 17:10:37 CET 2008


Author: alex
Date: Wed Mar 19 17:10:37 2008
New Revision: 20050

URL: http://svn.erp5.org?rev=20050&view=rev
Log:
Add a test case where the first property evaluated by Base._edit() is not
modified, and the second one is, causing the first one to be "lost".

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

Modified: erp5/trunk/products/ERP5/tests/testERP5Base.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testERP5Base.py?rev=20050&r1=20049&r2=20050&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testERP5Base.py (original)
+++ erp5/trunk/products/ERP5/tests/testERP5Base.py Wed Mar 19 17:10:37 2008
@@ -737,6 +737,25 @@
     self.assertEquals(organisation.getDefaultAddressCity(),'Lille')
     self.assertEquals(organisation.getDefaultAddressZipCode(), '59000')
 
+    # retry last action, inverting the modified property
+    # XXX Whether this test is usefull or not completely depends on Python
+    # implementation. Python currently does not guarantee the order of a dict,
+    # so it might very well be that at some point, a change in the
+    # implementation makes the test always succeed, where it would fail with
+    # the curent implementation.
+    person.manage_delObjects(['default_address'])
+
+    person.edit(
+        default_address_city='Lille',
+        default_address_zip_code='69000')
+
+    self.assertNotEquals(person.getDefaultAddress(),
+        organisation.getDefaultAddress())
+    self.assertEquals(person.getDefaultAddressCity(),'Lille')
+    self.assertEquals(person.getDefaultAddressZipCode(), '69000')
+    self.assertEquals(organisation.getDefaultAddressCity(),'Lille')
+    self.assertEquals(organisation.getDefaultAddressZipCode(), '59000')
+
   ##################################
   ##  Tests
   ##################################




More information about the Erp5-report mailing list