From d8b2f7aef5696540724e0e89ae9eaf87394e33c0 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Wed, 23 Aug 2006 12:58:35 +0000
Subject: [PATCH] added a test wich proove that currenctly there is a bug, when
 we change the address of a person, then it will change the address of the
 related organisation

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9350 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/tests/testERP5HR.py | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/product/ERP5/tests/testERP5HR.py b/product/ERP5/tests/testERP5HR.py
index c819455d40..90b773597f 100644
--- a/product/ERP5/tests/testERP5HR.py
+++ b/product/ERP5/tests/testERP5HR.py
@@ -698,6 +698,19 @@ class TestHR(ERP5TypeTestCase):
     self.assertEquals( new_career_step.getSubordinationTitle(),
                        new_organisation_title )
     
+  def stepCheckChangePersonAddress(self, sequence=None, **kw) :
+    """
+    We must make sure that if we change the address of a person,
+    then it will not change the address of the organisation.
+    """
+    person = sequence.get('person')
+    organisation = sequence.get('organisation')
+    self.assertEquals(organisation.getDefaultAddressCity(),'Lille')
+    self.assertEquals(person.getDefaultAddressCity(),'Lille')
+    person.setDefaultAddressCity('La Garnache')
+    self.assertEquals(person.getDefaultAddressCity(),'La Garnache')
+    self.assertEquals(organisation.getDefaultAddressCity(),'Lille')
+
   ##################################
   ##  Tests
   ##################################
@@ -749,6 +762,22 @@ class TestHR(ERP5TypeTestCase):
     sequence_list.addSequenceString(sequence_string)
     sequence_list.play(self)
 
+  def test_04_SubordinationAndAddress(self, quiet=QUIET, run=RUN_ALL_TEST):
+    """
+      Tests that career steps subordination properties behave correctly
+    """
+    if not run: return
+    sequence_list = SequenceList()
+    step_list = [ 'CreatePerson'
+                , 'CreateOrganisation'
+                , 'SetOrganisationAddress'
+                , 'SetPersonCareer'
+                , 'CheckChangePersonAddress'
+                ]
+    sequence_string = ' '.join(step_list)
+    sequence_list.addSequenceString(sequence_string)
+    sequence_list.play(self)
+
 if __name__ == '__main__':
   framework()
 else:
-- 
2.30.9