Commit 2b7e8701 authored by Aurel's avatar Aurel

Merge remote-tracking branch 'origin/master' into test_page

parents 6431f953 5ec2f886
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
string:${object_url}/accounting_module/AccountModule_viewAccountStatementReportDialog?mirror_section=${object/getRelativeUrl}&your_portal_skin=ODS&your_format= string:${object_url}/AccountModule_viewAccountStatementReportDialog?mirror_section=${object/getRelativeUrl}&your_portal_skin=ODS&your_format=
]]></string> </value> ]]></string> </value>
</item> </item>
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>string:${object_url}/accounting_module/AccountModule_viewAccountStatementReportDialog?mirror_section=${object/getRelativeUrl}</string> </value> <value> <string>string:${object_url}/AccountModule_viewAccountStatementReportDialog?mirror_section=${object/getRelativeUrl}</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
string:${object_url}/accounting_module/AccountModule_viewGeneralLedgerReportDialog?mirror_section=${object/getRelativeUrl}&your_portal_skin=ODS&your_format= string:${object_url}/AccountModule_viewGeneralLedgerReportDialog?mirror_section=${object/getRelativeUrl}&your_portal_skin=ODS&your_format=
]]></string> </value> ]]></string> </value>
</item> </item>
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>string:${object_url}/accounting_module/AccountModule_viewGeneralLedgerReportDialog?mirror_section=${object/getRelativeUrl}</string> </value> <value> <string>string:${object_url}/AccountModule_viewGeneralLedgerReportDialog?mirror_section=${object/getRelativeUrl}</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
1557 1558
\ No newline at end of file \ No newline at end of file
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
<item> <item>
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list/> <list>
<string>editable</string>
</list>
</value> </value>
</item> </item>
<item> <item>
...@@ -50,6 +52,12 @@ ...@@ -50,6 +52,12 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>editable</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -69,6 +77,10 @@ ...@@ -69,6 +77,10 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_start_date</string> </value> <value> <string>my_start_date</string> </value>
...@@ -87,4 +99,17 @@ ...@@ -87,4 +99,17 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: cell.Base_checkPermission(cell.getRelativeUrl(), "Modify portal content")</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
<item> <item>
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list/> <list>
<string>editable</string>
</list>
</value> </value>
</item> </item>
<item> <item>
...@@ -50,6 +52,12 @@ ...@@ -50,6 +52,12 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>editable</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -69,6 +77,10 @@ ...@@ -69,6 +77,10 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_stop_date</string> </value> <value> <string>my_stop_date</string> </value>
...@@ -87,4 +99,17 @@ ...@@ -87,4 +99,17 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: cell.Base_checkPermission(cell.getRelativeUrl(), "Modify portal content")</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
<item> <item>
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list/> <list>
<string>editable</string>
</list>
</value> </value>
</item> </item>
<item> <item>
...@@ -56,6 +58,12 @@ ...@@ -56,6 +58,12 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>editable</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -75,6 +83,10 @@ ...@@ -75,6 +83,10 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_title</string> </value> <value> <string>my_title</string> </value>
...@@ -124,37 +136,37 @@ ...@@ -124,37 +136,37 @@
<item> <item>
<key> <string>ampm</string> </key> <key> <string>ampm</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
<key> <string>day</string> </key> <key> <string>day</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
<key> <string>hour</string> </key> <key> <string>hour</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
<key> <string>minute</string> </key> <key> <string>minute</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAc=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
<key> <string>month</string> </key> <key> <string>month</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAc=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAg=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
<key> <string>year</string> </key> <key> <string>year</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAg=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAk=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -227,6 +239,19 @@ ...@@ -227,6 +239,19 @@
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: cell.Base_checkPermission(cell.getRelativeUrl(), "Modify portal content")</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <tuple>
...@@ -489,7 +514,7 @@ ...@@ -489,7 +514,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="5" aka="AAAAAAAAAAU=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <tuple>
...@@ -744,7 +769,7 @@ ...@@ -744,7 +769,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="5" aka="AAAAAAAAAAU="> <record id="6" aka="AAAAAAAAAAY=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <tuple>
...@@ -999,7 +1024,7 @@ ...@@ -999,7 +1024,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="6" aka="AAAAAAAAAAY="> <record id="7" aka="AAAAAAAAAAc=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <tuple>
...@@ -1254,7 +1279,7 @@ ...@@ -1254,7 +1279,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="7" aka="AAAAAAAAAAc="> <record id="8" aka="AAAAAAAAAAg=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <tuple>
...@@ -1509,7 +1534,7 @@ ...@@ -1509,7 +1534,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="8" aka="AAAAAAAAAAg="> <record id="9" aka="AAAAAAAAAAk=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <tuple>
......
1059 1060
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category Membership Divergence Tester" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>journal_tester</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category Membership Divergence Tester</string> </value>
</item>
<item>
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>journal</string>
</tuple>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>journal divergence tester</string> </value>
</item>
</dictionary>
</pickle>
</record>
<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>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category Membership Divergence Tester" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>journal_tester</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category Membership Divergence Tester</string> </value>
</item>
<item>
<key> <string>tested_property</string> </key>
<value>
<tuple>
<string>journal</string>
</tuple>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>journal divergence tester</string> </value>
</item>
</dictionary>
</pickle>
</record>
<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>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
1 3
\ No newline at end of file \ No newline at end of file
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
<string>destination</string> <string>destination</string>
<string>source_section</string> <string>source_section</string>
<string>destination_section</string> <string>destination_section</string>
<string>journal</string>
<string>source_project</string> <string>source_project</string>
<string>destination_project</string> <string>destination_project</string>
<string>source_payment</string> <string>source_payment</string>
......
837 838
\ No newline at end of file \ No newline at end of file
...@@ -63,7 +63,6 @@ if multiplier is None:\n ...@@ -63,7 +63,6 @@ if multiplier is None:\n
\n \n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
\n \n
portal = context.getPortalObject()\n
simulation_state_set = set(simulation_state_list)\n simulation_state_set = set(simulation_state_list)\n
# We will use inventory API in order to find all quantities\n # We will use inventory API in order to find all quantities\n
before_confirmed_task_state_set = set(portal.getPortalPlannedOrderStateList() + \\\n before_confirmed_task_state_set = set(portal.getPortalPlannedOrderStateList() + \\\n
...@@ -150,7 +149,8 @@ column_url_script_list = []\n ...@@ -150,7 +149,8 @@ column_url_script_list = []\n
for item_url in item_title_dict.keys():\n for item_url in item_title_dict.keys():\n
column_url_script_list.append((item_url, "getColumnUrl"))\n column_url_script_list.append((item_url, "getColumnUrl"))\n
\n \n
context = context.asContext(column_list=column_list,\n context_kw = {}\n
context_kw.update(column_list=column_list,\n
at_date=at_date,\n at_date=at_date,\n
from_date=from_date,\n from_date=from_date,\n
simulation_state_list=simulation_state_list,\n simulation_state_list=simulation_state_list,\n
...@@ -158,6 +158,9 @@ context = context.asContext(column_list=column_list,\n ...@@ -158,6 +158,9 @@ context = context.asContext(column_list=column_list,\n
journal=journal,\n journal=journal,\n
multiplier=multiplier,\n multiplier=multiplier,\n
listbox_line_list=listbox_line_list)\n listbox_line_list=listbox_line_list)\n
context = context.getObject().asContext(**context_kw)\n
if batch_mode:\n
return context\n
return context.ResearchItemModule_viewResearchSummaryReportData()\n return context.ResearchItemModule_viewResearchSummaryReportData()\n
...@@ -165,7 +168,7 @@ return context.ResearchItemModule_viewResearchSummaryReportData()\n ...@@ -165,7 +168,7 @@ return context.ResearchItemModule_viewResearchSummaryReportData()\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>at_date=None, from_date=None, simulation_state_list=None, journal=None, multiplier=None, **kw</string> </value> <value> <string>at_date=None, from_date=None, simulation_state_list=None, journal=None, multiplier=None, batch_mode=False, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
##############################################################################
#
# Copyright (c) 2002-2013 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
##############################################################################
from DateTime import DateTime
from Products.ERP5.tests.testTaskReporting import TestTaskReportingMixin
class TestResearchItemSummaryReport(TestTaskReportingMixin):
"""
Test Research Items Reports
"""
def getTitle(self):
return "ResearchItemSummaryReport"
def afterSetUp(self):
"""Make sure to initialize needed categories
"""
super(TestResearchItemSummaryReport, self).afterSetUp()
journal_base_category = self.portal.portal_categories.journal
for category_id in ("operation", "research"):
if not journal_base_category.has_key(category_id):
journal_base_category.newContent(
portal_type='Category', title=category_id.title(),
reference=category_id, id=category_id)
# create items
if not self.portal.research_item_module.has_key('Item_1'):
self.portal.research_item_module.newContent(title="Item_1",
id="Item_1", portal_type="Research Item")
if not self.portal.research_item_module.has_key('Item_2'):
self.portal.research_item_module.newContent(title="Item_2",
id="Item_2", portal_type="Research Item")
def getBusinessTemplateList(self):
"""
Tuple of Business Templates we need to install
"""
bt_list = super(TestResearchItemSummaryReport, self).getBusinessTemplateList()
return list(bt_list) + ["erp5_research_item"]
def _makeOneTask(self, **kw):
task =super(TestResearchItemSummaryReport, self)._makeOneTask(
resource='product_module/development',
source_section='organisation_module/Organisation_1',
destination='organisation_module/Organisation_2',
destination_section='organisation_module/Organisation_2',
source_project='project_module/Project_1/Line_1',
start_date=DateTime('2013/01/10'),
stop_date=DateTime('2013/02/15'),
journal="research",
simulation_state="confirmed",
**kw)
return task
def testResearchSummaryReport(self):
"""
Test research summary report available on item research module
"""
report = self.portal.research_item_module.ResearchItemModule_callResearchSummaryReport
def callReport():
return report(from_date=from_date, at_date=at_date, batch_mode=True,
journal="research", simulation_state_list=["confirmed"])
def getDataResult(result):
data_list = []
column_id_list = [x[0] for x in result.column_list]
self.assertEquals(column_id_list[0], "source_title")
self.assertEquals(column_id_list[-1], "total")
column_id_list.pop(0)
column_id_list.pop(-1)
column_id_list.sort()
column_id_list = ["source_title"] + column_id_list + ["total"]
for line in result.listbox_line_list:
line_data = []
for property_name in column_id_list:
line_data.append(line.getProperty(property_name))
data_list.append(line_data)
data_list.sort(key=lambda x: x[0])
column_list = [x for x in result.column_list]
column_list.sort(key=lambda x: column_id_list.index(x[0]))
return [x[1] for x in column_list], data_list
# First call it when it is empty
from_date = DateTime("2013/01/01")
at_date = DateTime("2014/01/01")
result = callReport()
# Initially we should have only one line for an empty total
self.assertEquals((["Worker", "Total"],
[["Total", None]]),
getDataResult(result))
# Then create one task with no item, see if we it is displayed in the report
self._makeOneTask(
title='Task 1',
task_line_quantity=3,
source='person_module/Person_1',
)
result = callReport()
self.assertEquals((["Worker", "undefined", "Total"],
[["Person_1", 3, 3],
["Total", 3, 3]]),
getDataResult(result))
# Then create one task with item, see if we it is displayed in the report
self._makeOneTask(
title='Task 2',
task_line_quantity=5.2,
source='person_module/Person_2',
line_aggregate_relative_url='research_item_module/Item_1',
)
result = callReport()
self.assertEquals((["Worker", "undefined", "Item_1", "Total"],
[["Person_1", 3, None, 3],
["Person_2", None, 5.2, 5.2],
["Total", 3, 5.2, 8.2]]),
getDataResult(result))
# 3 additional tasks to check sums
self._makeOneTask(
title='Task 3',
task_line_quantity=2.4,
source='person_module/Person_2',
line_aggregate_relative_url='research_item_module/Item_1',
)
self._makeOneTask(
title='Task 4',
task_line_quantity=1.7,
source='person_module/Person_1',
line_aggregate_relative_url='research_item_module/Item_2',
)
self._makeOneTask(
title='Task 5',
task_line_quantity=0.9,
source='person_module/Person_2',
line_aggregate_relative_url='research_item_module/Item_2',
)
result = callReport()
self.assertEquals((["Worker", "undefined", "Item_1", "Item_2", "Total"],
[["Person_1", 3, None, 1.7, 4.7],
["Person_2", None, 7.6, 0.9, 8.5],
["Total", 3, 7.6, 2.6, 13.2]]),
getDataResult(result))
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testResearchItemSummaryReport</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testResearchItemSummaryReport</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<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>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>seb</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1385030033.93</float>
<string>GMT+1</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
6 8
\ No newline at end of file \ No newline at end of file
test.erp5.testResearchItemSummaryReport
\ No newline at end of file
erp5_full_text_myisam_catalog
erp5_simulation
erp5_configurator_standard_trade_template
erp5_simulation_test
erp5_project
...@@ -85,6 +85,26 @@ ...@@ -85,6 +85,26 @@
<string>resource_title</string> <string>resource_title</string>
<string>Product or Service</string> <string>Product or Service</string>
</tuple> </tuple>
<tuple>
<string>priced_quantity</string>
<string>Priced Quantity</string>
</tuple>
<tuple>
<string>base_price</string>
<string>Base Price</string>
</tuple>
<tuple>
<string>additional_price</string>
<string>Additional Price</string>
</tuple>
<tuple>
<string>discount_ratio</string>
<string>Discount Ratio</string>
</tuple>
<tuple>
<string>surcharge_ratio</string>
<string>Surcharge Ratio</string>
</tuple>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -85,6 +85,26 @@ ...@@ -85,6 +85,26 @@
<string>resource_title</string> <string>resource_title</string>
<string>Product or Service</string> <string>Product or Service</string>
</tuple> </tuple>
<tuple>
<string>priced_quantity</string>
<string>Priced Quantity</string>
</tuple>
<tuple>
<string>base_price</string>
<string>Base Price</string>
</tuple>
<tuple>
<string>additional_price</string>
<string>Additional Price</string>
</tuple>
<tuple>
<string>discount_ratio</string>
<string>Discount Ratio</string>
</tuple>
<tuple>
<string>surcharge_ratio</string>
<string>Surcharge Ratio</string>
</tuple>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -85,6 +85,26 @@ ...@@ -85,6 +85,26 @@
<string>resource_title</string> <string>resource_title</string>
<string>Product or Service</string> <string>Product or Service</string>
</tuple> </tuple>
<tuple>
<string>priced_quantity</string>
<string>Priced Quantity</string>
</tuple>
<tuple>
<string>base_price</string>
<string>Base Price</string>
</tuple>
<tuple>
<string>additional_price</string>
<string>Additional Price</string>
</tuple>
<tuple>
<string>discount_ratio</string>
<string>Discount Ratio</string>
</tuple>
<tuple>
<string>surcharge_ratio</string>
<string>Surcharge Ratio</string>
</tuple>
</list> </list>
</value> </value>
</item> </item>
......
1175 1176
\ No newline at end of file \ No newline at end of file
...@@ -5784,7 +5784,9 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -5784,7 +5784,9 @@ Business Template is a set of definitions, such as skins, portal types and categ
""" """
missing_dep_list = self.getMissingDependencyList() missing_dep_list = self.getMissingDependencyList()
if len(missing_dep_list) != 0: if len(missing_dep_list) != 0:
raise BusinessTemplateMissingDependency, 'Impossible to install, please install the following dependencies before: %s'%repr(missing_dep_list) raise BusinessTemplateMissingDependency, \
'Impossible to install %s, please install the following dependencies before: %s' \
%(self.getTitle(), repr(missing_dep_list))
def getMissingDependencyList(self): def getMissingDependencyList(self):
""" """
......
...@@ -44,15 +44,21 @@ class TestTaskReportingMixin(ERP5ReportTestCase): ...@@ -44,15 +44,21 @@ class TestTaskReportingMixin(ERP5ReportTestCase):
'erp5_project', 'erp5_simulation_test') 'erp5_project', 'erp5_simulation_test')
@reindex @reindex
def _makeOneTask(self, simulation_state='planned', **kw): def _makeOneTask(self, simulation_state='planned',
line_aggregate_relative_url=None, **kw):
"""Create a task, support many options""" """Create a task, support many options"""
task = self.portal.task_module.newContent(portal_type='Task', task = self.portal.task_module.newContent(portal_type='Task',
specialise=self.business_process) specialise=self.business_process)
task._edit(**kw) task._edit(**kw)
if line_aggregate_relative_url:
task_line, = task.objectValues(portal_type="Task Line")
task_line.setAggregate(line_aggregate_relative_url)
if simulation_state == 'planned': if simulation_state == 'planned':
task.plan() task.plan()
if simulation_state == 'confirmed': if simulation_state == 'confirmed':
task.confirm() task.confirm()
return task
def afterSetUp(self): def afterSetUp(self):
"""Setup the fixture. """Setup the fixture.
......
...@@ -731,6 +731,16 @@ class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase): ...@@ -731,6 +731,16 @@ class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase):
return sorted([ str(message.getMessage()) return sorted([ str(message.getMessage())
for message in obj.checkConsistency() ]) for message in obj.checkConsistency() ])
def _callSetUpOnce(self):
setup_once = getattr(self, 'setUpOnce', None)
if setup_once is not None and \
not getattr(self.portal, 'set_up_once_called', 0):
self.portal.set_up_once_called = 1
ZopeTestCase._print('Executing setUpOnce ... ')
start = time.time()
setup_once()
ZopeTestCase._print('done (%.3fs)\n' % (time.time() - start))
class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin): class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
def getPortalName(self): def getPortalName(self):
...@@ -1073,16 +1083,7 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin): ...@@ -1073,16 +1083,7 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin):
'Assignor', 'Author', 'Auditor', 'Associate'], []) 'Assignor', 'Author', 'Auditor', 'Associate'], [])
user = uf.getUserById('ERP5TypeTestCase').__of__(uf) user = uf.getUserById('ERP5TypeTestCase').__of__(uf)
setup_once = getattr(self, 'setUpOnce', None) self._callSetUpOnce()
if setup_once is not None and \
not getattr(portal, 'set_up_once_called', 0):
portal.set_up_once_called = 1
if not quiet:
ZopeTestCase._print('Executing setUpOnce ... ')
start = time.time()
setup_once()
if not quiet:
ZopeTestCase._print('done (%.3fs)\n' % (time.time() - start))
# Enable reindexing # Enable reindexing
# Do hot reindexing # Does not work # Do hot reindexing # Does not work
......
...@@ -10,6 +10,7 @@ import signal ...@@ -10,6 +10,7 @@ import signal
import shutil import shutil
import errno import errno
import random import random
import transaction
from glob import glob from glob import glob
import backportUnittest import backportUnittest
...@@ -303,10 +304,16 @@ class ERP5TypeTestLoader(unittest.TestLoader): ...@@ -303,10 +304,16 @@ class ERP5TypeTestLoader(unittest.TestLoader):
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.ERP5TypeLiveTestCase import ERP5TypeLiveTestCase from Products.ERP5Type.tests.ERP5TypeLiveTestCase import ERP5TypeLiveTestCase
class ComponentTestCase(ERP5TypeLiveTestCase):
def setUp(self):
super(ComponentTestCase, self).setUp()
self._callSetUpOnce()
# Bootstrap has been done in loadTestsFromNames, so the test can now # Bootstrap has been done in loadTestsFromNames, so the test can now
# be loaded like any Live Test on a real instance # be loaded like any Live Test on a real instance
if ERP5TypeLiveTestCase not in ERP5TypeTestCase.__bases__: if ComponentTestCase not in ERP5TypeTestCase.__bases__:
ERP5TypeTestCase.__bases__ = ERP5TypeLiveTestCase, ERP5TypeTestCase.__bases__ = ComponentTestCase,
# TestLoader() does not perform any import so import the Module manually # TestLoader() does not perform any import so import the Module manually
module = __import__('erp5.component.test', module = __import__('erp5.component.test',
...@@ -675,6 +682,14 @@ def runUnitTestList(test_list, verbosity=1, debug=0, run_only=None): ...@@ -675,6 +682,14 @@ def runUnitTestList(test_list, verbosity=1, debug=0, run_only=None):
root_logger.handlers.append(loghandler.StreamHandler(sys.stderr)) root_logger.handlers.append(loghandler.StreamHandler(sys.stderr))
_print('done (%.3fs)\n' % (time.time() - _start)) _print('done (%.3fs)\n' % (time.time() - _start))
result = TestRunner(verbosity=verbosity).run(suite) result = TestRunner(verbosity=verbosity).run(suite)
transaction.commit()
except:
import traceback
print "runUnitTestList Exception : %r" % (traceback.print_exc(),)
# finally does not expect opened transaction, even in the
# case of a Ctrl-C.
transaction.abort()
raise
finally: finally:
ProcessingNodeTestCase.unregisterNode() ProcessingNodeTestCase.unregisterNode()
Storage.close() Storage.close()
......
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