[Erp5-report] r37742 fabien - /erp5/trunk/products/ERP5/tests/testPackingList.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Aug 12 11:14:29 CEST 2010
Author: fabien
Date: Thu Aug 12 11:14:26 2010
New Revision: 37742
URL: http://svn.erp5.org?rev=37742&view=rev
Log:
add a test to check that it's possible to sort result in getMovementList
Modified:
erp5/trunk/products/ERP5/tests/testPackingList.py
Modified: erp5/trunk/products/ERP5/tests/testPackingList.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testPackingList.py?rev=37742&r1=37741&r2=37742&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testPackingList.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testPackingList.py [utf8] Thu Aug 12 11:14:26 2010
@@ -1709,6 +1709,44 @@ class TestPackingList(TestPackingListMix
self._testSubContentReindexing(packing_list, [container, container_line,
container_cell])
+ def test_PackingList_getMovementListSorting(self):
+ '''Test that is possible to sort getMovementList result passing it sort_on
+ parameter
+ '''
+ packing_list = self.portal.getDefaultModule(self.packing_list_portal_type).newContent(
+ portal_type=self.packing_list_portal_type,
+ title='Packing List')
+ # create some packing list lines
+ line_bbb = packing_list.newContent(
+ portal_type=self.packing_list_line_portal_type,
+ reference='bbb',
+ int_index=1)
+ line_aaa = packing_list.newContent(
+ portal_type=self.packing_list_line_portal_type,
+ reference='aaa',
+ int_index=2)
+ line_ccc = packing_list.newContent(
+ portal_type=self.packing_list_line_portal_type,
+ reference='ccc',
+ int_index=4)
+ line_ddd = packing_list.newContent(
+ portal_type=self.packing_list_line_portal_type,
+ reference='ddd',
+ int_index=3)
+ transaction.commit()
+ self.tic()
+ # check it's possible to sort by reference
+ reference_result = packing_list.getMovementList(sort_on=\
+ [('reference', 'descending')])
+ self.assertEquals(reference_result, [line_aaa, line_bbb, line_ccc,
+ line_ddd])
+
+ # check it's possible to sort by int_index
+ int_index_result = packing_list.getMovementList(sort_on=\
+ [('int_index', 'ascending')])
+ self.assertEquals(int_index_result, [line_ccc, line_ddd, line_aaa,
+ line_bbb])
+
class TestSolvingPackingList(TestPackingListMixin, ERP5TypeTestCase):
quiet = 0
More information about the Erp5-report
mailing list