[Erp5-report] r17817 - /erp5/trunk/products/ERP5/tests/testERP5HR.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Nov 27 13:32:49 CET 2007
Author: jerome
Date: Tue Nov 27 13:32:49 2007
New Revision: 17817
URL: http://svn.erp5.org?rev=17817&view=rev
Log:
test that acquired function are not shown in the UI
Modified:
erp5/trunk/products/ERP5/tests/testERP5HR.py
Modified: erp5/trunk/products/ERP5/tests/testERP5HR.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testERP5HR.py?rev=17817&r1=17816&r2=17817&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testERP5HR.py (original)
+++ erp5/trunk/products/ERP5/tests/testERP5HR.py Tue Nov 27 13:32:49 2007
@@ -882,6 +882,31 @@
email = pers.getDefaultEmailValue()
self.assertEquals('Default Email', str(email.getTranslatedId()))
+ def test_SubordinationAcquisitionAndFunction(self):
+ # function is acquired from the subordination, organisation function are
+ # usually only nodes, and persons functions are leaves.
+ function_node = self.portal.portal_categories.function.newContent(
+ portal_type='Category', id='function_node', title='Function Node')
+ function_leave = function_node.newContent(
+ portal_type='Category', id='function_leave', title='Function Leave')
+ self.portal.portal_caches.clearAllCache()
+ organisation = self.getOrganisationModule().newContent(
+ portal_type='Organisation',
+ function_value=function_node)
+ person = self.getPersonModule().newContent(portal_type='Person',
+ career_subordination_value=organisation)
+ # on Organisation_view, the user usually select node for functions:
+ organisation_view_html = organisation.Organisation_view()
+ self.assertTrue('Function Node' in organisation_view_html)
+ # person acquire function from the organisation
+ self.assertEquals(person.getFunctionValue(), function_node)
+ # but the user interface does not show the acquired value in this case
+ person_view_html = person.Person_view()
+ self.assertTrue('Function Leave' in person_view_html)
+ self.assertTrue('value="function_node/function_leave"'
+ in person_view_html)
+ self.assertTrue('value="function_node"' not in person_view_html)
+
def test_suite():
suite = unittest.TestSuite()
More information about the Erp5-report
mailing list