Commit ae4fc245 authored by Łukasz Nowak's avatar Łukasz Nowak

erp5_item: Cleanup test

parent c8f5fce8
...@@ -31,7 +31,6 @@ import unittest ...@@ -31,7 +31,6 @@ import unittest
from DateTime import DateTime from DateTime import DateTime
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import reindex from Products.ERP5Type.tests.utils import reindex
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5.tests.testInvoice import TestSaleInvoiceMixin from Products.ERP5.tests.testInvoice import TestSaleInvoiceMixin
from Products.ERP5.tests.utils import newSimulationExpectedFailure from Products.ERP5.tests.utils import newSimulationExpectedFailure
...@@ -159,7 +158,6 @@ class TestItemMixin(TestSaleInvoiceMixin): ...@@ -159,7 +158,6 @@ class TestItemMixin(TestSaleInvoiceMixin):
def stepCreateItemList(self, sequence=None, sequence_list=None, **kw): def stepCreateItemList(self, sequence=None, sequence_list=None, **kw):
""" Create some items """ """ Create some items """
item_module = self.getPortal().item_module item_module = self.getPortal().item_module
resource = sequence.get('resource')
item = item_module.newContent(portal_type=self.item_portal_type) item = item_module.newContent(portal_type=self.item_portal_type)
sequence.edit(item_list=[item]) sequence.edit(item_list=[item])
...@@ -1137,7 +1135,6 @@ class TestItem(TestItemMixin, ERP5TypeTestCase): ...@@ -1137,7 +1135,6 @@ class TestItem(TestItemMixin, ERP5TypeTestCase):
self.assertEqual(1, len(item_by_hand_value_list)) self.assertEqual(1, len(item_by_hand_value_list))
self.assertEqual(1, len(item_by_dialog_value_list)) self.assertEqual(1, len(item_by_dialog_value_list))
item_by_hand = item_by_hand_value_list[0]
item_by_dialog = item_by_dialog_value_list[0] item_by_dialog = item_by_dialog_value_list[0]
self.assertTrue(item_by_dialog.getTitle().startswith(resource.getTitle())) self.assertTrue(item_by_dialog.getTitle().startswith(resource.getTitle()))
...@@ -1281,42 +1278,42 @@ class TestItemScripts(ERP5TypeTestCase): ...@@ -1281,42 +1278,42 @@ class TestItemScripts(ERP5TypeTestCase):
# with line # with line
def test_Item_getResourceValue(self): def test_Item_getResourceValue(self):
self.assertEqual(None, self.item.Item_getResourceValue()) self.assertEqual(None, self.item.Item_getResourceValue())
line = self._makeSalePackingListLine() self._makeSalePackingListLine()
self.assertEqual(self.product, self.item.Item_getResourceValue()) self.assertEqual(self.product, self.item.Item_getResourceValue())
self.assertEqual(None, self.item.Item_getResourceValue( self.assertEqual(None, self.item.Item_getResourceValue(
at_date=DateTime() - 2)) at_date=DateTime() - 2))
def test_Item_getResourceTitle(self): def test_Item_getResourceTitle(self):
self.assertEqual(None, self.item.Item_getResourceTitle()) self.assertEqual(None, self.item.Item_getResourceTitle())
line = self._makeSalePackingListLine() self._makeSalePackingListLine()
self.assertEqual('Product', self.item.Item_getResourceTitle()) self.assertEqual('Product', self.item.Item_getResourceTitle())
self.assertEqual(None, self.item.Item_getResourceTitle( self.assertEqual(None, self.item.Item_getResourceTitle(
at_date=DateTime() - 2)) at_date=DateTime() - 2))
def test_Item_getCurrentOwnerValue(self): def test_Item_getCurrentOwnerValue(self):
self.assertEqual(None, self.item.Item_getCurrentOwnerValue()) self.assertEqual(None, self.item.Item_getCurrentOwnerValue())
line = self._makeSalePackingListLine() self._makeSalePackingListLine()
self.assertEqual(self.section, self.item.Item_getCurrentOwnerValue()) self.assertEqual(self.section, self.item.Item_getCurrentOwnerValue())
self.assertEqual(None, self.assertEqual(None,
self.item.Item_getCurrentOwnerValue(at_date=DateTime() - 2)) self.item.Item_getCurrentOwnerValue(at_date=DateTime() - 2))
def test_Item_getCurrentOwnerTitle(self): def test_Item_getCurrentOwnerTitle(self):
self.assertEqual(None, self.item.Item_getCurrentOwnerTitle()) self.assertEqual(None, self.item.Item_getCurrentOwnerTitle())
line = self._makeSalePackingListLine() self._makeSalePackingListLine()
self.assertEqual('Section', self.item.Item_getCurrentOwnerTitle()) self.assertEqual('Section', self.item.Item_getCurrentOwnerTitle())
self.assertEqual(None, self.assertEqual(None,
self.item.Item_getCurrentOwnerTitle(at_date=DateTime() - 2)) self.item.Item_getCurrentOwnerTitle(at_date=DateTime() - 2))
def test_Item_getCurrentSiteValue(self): def test_Item_getCurrentSiteValue(self):
self.assertEqual(None, self.item.Item_getCurrentSiteValue()) self.assertEqual(None, self.item.Item_getCurrentSiteValue())
line = self._makeSalePackingListLine() self._makeSalePackingListLine()
self.assertEqual(self.node, self.item.Item_getCurrentSiteValue()) self.assertEqual(self.node, self.item.Item_getCurrentSiteValue())
self.assertEqual(None, self.item.Item_getCurrentSiteValue( self.assertEqual(None, self.item.Item_getCurrentSiteValue(
at_date=DateTime() - 2)) at_date=DateTime() - 2))
def test_Item_getCurrentSiteTitle(self): def test_Item_getCurrentSiteTitle(self):
self.assertEqual(None, self.item.Item_getCurrentSiteTitle()) self.assertEqual(None, self.item.Item_getCurrentSiteTitle())
line = self._makeSalePackingListLine() self._makeSalePackingListLine()
self.assertEqual('Node', self.item.Item_getCurrentSiteTitle()) self.assertEqual('Node', self.item.Item_getCurrentSiteTitle())
self.assertEqual(None, self.assertEqual(None,
self.item.Item_getCurrentSiteTitle(at_date=DateTime() - 2)) self.item.Item_getCurrentSiteTitle(at_date=DateTime() - 2))
...@@ -1343,7 +1340,7 @@ class TestItemScripts(ERP5TypeTestCase): ...@@ -1343,7 +1340,7 @@ class TestItemScripts(ERP5TypeTestCase):
destination_section_value=self.section, destination_section_value=self.section,
specialise_value=self.portal.business_process_module.erp5_default_business_process, specialise_value=self.portal.business_process_module.erp5_default_business_process,
start_date=DateTime() - 1,) start_date=DateTime() - 1,)
line = packing_list.newContent( packing_list.newContent(
portal_type='Sale Packing List Line', portal_type='Sale Packing List Line',
quantity=1, quantity=1,
resource_value=self.product, resource_value=self.product,
......
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>testItem</string> </value> <value> <string>testItem</string> </value>
...@@ -39,18 +45,7 @@ ...@@ -39,18 +45,7 @@
<item> <item>
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <value>
<tuple> <tuple/>
<string>W:174, 4: Unused variable \'resource\' (unused-variable)</string>
<string>W:1152, 4: Unused variable \'item_by_hand\' (unused-variable)</string>
<string>W:1302, 4: Unused variable \'line\' (unused-variable)</string>
<string>W:1309, 4: Unused variable \'line\' (unused-variable)</string>
<string>W:1316, 4: Unused variable \'line\' (unused-variable)</string>
<string>W:1323, 4: Unused variable \'line\' (unused-variable)</string>
<string>W:1330, 4: Unused variable \'line\' (unused-variable)</string>
<string>W:1337, 4: Unused variable \'line\' (unused-variable)</string>
<string>W:1364, 4: Unused variable \'line\' (unused-variable)</string>
<string>W: 34, 0: Unused newSecurityManager imported from AccessControl.SecurityManagement (unused-import)</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -60,13 +55,28 @@ ...@@ -60,13 +55,28 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -79,7 +89,7 @@ ...@@ -79,7 +89,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -88,7 +98,7 @@ ...@@ -88,7 +98,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle> </pickle>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment