[Erp5-report] r28829 - /erp5/trunk/products/ERP5/tests/testItem.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Sep 4 15:47:52 CEST 2009
Author: jerome
Date: Fri Sep 4 15:47:51 2009
New Revision: 28829
URL: http://svn.erp5.org?rev=28829&view=rev
Log:
fix the problem noted in r28801, those test fails when running after TestItem,
because TestItem was changing global site preference.
Instead of modifying the site preference that will affect individual variation
of all products, set individual base category list on the product in createVariatedResource
Modified:
erp5/trunk/products/ERP5/tests/testItem.py
Modified: erp5/trunk/products/ERP5/tests/testItem.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testItem.py?rev=28829&r1=28828&r2=28829&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testItem.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testItem.py [utf8] Fri Sep 4 15:47:51 2009
@@ -30,7 +30,6 @@
import transaction
from DateTime import DateTime
-from Testing import ZopeTestCase
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import reindex
from AccessControl.SecurityManagement import newSecurityManager
@@ -79,20 +78,13 @@
return resource
def createVariatedResource(self,title=None):
- preference = self.portal.portal_preferences
- portal_workflow = self.portal.portal_workflow
- pref = preference.newContent(portal_type='System Preference')
- pref.setPreferredProductIndividualVariationBaseCategoryList(['size'])
- portal_workflow.doActionFor(pref, 'enable_action')
- transaction.commit()
- self.tic()
-
resource_portal_type = 'Product'
resource_module = self.portal.getDefaultModule(resource_portal_type)
resource = resource_module.newContent(portal_type=resource_portal_type)
resource.edit(
title = "VariatedResource%s" % resource.getId(),
)
+ resource.setIndividualVariationBaseCategoryList(('size',))
resource.setQuantityUnit('unit/piece')
resource.setAggregatedPortalTypeList('Item')
resource.setRequiredAggregatedPortalTypeList('Item')
@@ -754,8 +746,6 @@
return cell
def test_Item_getVariationCategoryList(self):
- ZopeTestCase._print("\nWARNING test_Item_getVariationCategoryList"
- " fails when it is executed after TestItem, and with the same portal_id")
self.assertEquals([], self.item.Item_getVariationCategoryList())
self._makeSalePackingListCellWithVariation()
self.assertEquals(['size/small'], self.item.Item_getVariationCategoryList())
@@ -763,8 +753,6 @@
self.item.Item_getVariationCategoryList(at_date=DateTime() - 2))
def test_Item_getVariationRangeCategoryItemList(self):
- ZopeTestCase._print("\nWARNING test_Item_getVariationRangeCategoryItemList"
- " fails when it is executed after TestItem, and with the same portal_id")
self.assertEquals([], self.item.Item_getVariationRangeCategoryItemList())
self._makeSalePackingListCellWithVariation()
self.assertEquals([['Big', 'size/big'],
More information about the Erp5-report
mailing list