From 02eb898077b0822b23761bd3712ff1b92aa436a3 Mon Sep 17 00:00:00 2001
From: Alexandre Boeglin <alex@nexedi.com>
Date: Fri, 29 Feb 2008 16:29:29 +0000
Subject: [PATCH] in test_13, define edit_order when calling edit(), and test
 both possibilities

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19615 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/tests/testInteractionWorkflow.py | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/product/ERP5/tests/testInteractionWorkflow.py b/product/ERP5/tests/testInteractionWorkflow.py
index a1c3415fbb..d5b7cd4a07 100644
--- a/product/ERP5/tests/testInteractionWorkflow.py
+++ b/product/ERP5/tests/testInteractionWorkflow.py
@@ -422,9 +422,10 @@ class TestInteractionWorkflow(ERP5TypeTestCase):
     self.assertEquals(organisation.getTitle(), 'foo')
     self.assertEquals(organisation.getVatCode(), 'bar')
 
-    organisation.edit(title='baz', vat_code='bar')
+    organisation.edit(title='baz', vat_code='bar', edit_order=['vat_code',
+      'title'])
     self.assertEquals(organisation.getTitle(),'baz')
-    # here, the wrong behaviour was:
+    # here, the wrong behaviour is:
     # - edit:setTitle(baz)
     # - interaction:setVatCode(bara)
     # - edit:setVatCode(bar)
@@ -433,6 +434,16 @@ class TestInteractionWorkflow(ERP5TypeTestCase):
     # - edit:setVatCode(bar)
     # - interaction:setVatCode(bara)
     self.assertEquals(organisation.getVatCode(),'bara')
+    # now, test the other way around
+    organisation.edit(title='baz', vat_code='bara', edit_order=['title',
+      'vat_code'])
+    self.assertEquals(organisation.getTitle(),'baz')
+    # here, we assert the failure:
+    # - edit:setTitle(baz)
+    # - interaction:setVatCode(baraa)
+    # - edit:setVatCode(bara)
+    self.assertEquals(organisation.getVatCode(),'bara')
+
     
   def test_14_BeforeScriptParameters(self, quiet=0, run=run_all_test):
     if not run: return
-- 
2.30.9