Commit 7153d667 authored by Arnaud Fontaine's avatar Arnaud Fontaine

ZODB Components: erp5_forge: Migrate testTemplateTool.

parent bbaf3f5d
...@@ -51,7 +51,6 @@ class TestTemplateTool(ERP5TypeTestCase): ...@@ -51,7 +51,6 @@ class TestTemplateTool(ERP5TypeTestCase):
return ('erp5_core_proxy_field_legacy', return ('erp5_core_proxy_field_legacy',
'erp5_full_text_mroonga_catalog', 'erp5_full_text_mroonga_catalog',
'erp5_base', 'erp5_base',
'erp5_stock_cache',
'erp5_csv_style', 'erp5_csv_style',
'erp5_crm', 'erp5_crm',
'erp5_forge') 'erp5_forge')
...@@ -353,7 +352,7 @@ class TestTemplateTool(ERP5TypeTestCase): ...@@ -353,7 +352,7 @@ class TestTemplateTool(ERP5TypeTestCase):
try: try:
bt.export(root, local=1) bt.export(root, local=1)
with open(os.path.join(root, 'bt', 'title')) as f: with open(os.path.join(root, 'bt', 'title')) as f:
self.assertTrue('test_core', f.read()) self.assertEqual('test_core', f.read())
# We don't export revision anymore. # We don't export revision anymore.
self.assertFalse(os.path.exists(os.path.join(root, 'bt', 'revision'))) self.assertFalse(os.path.exists(os.path.join(root, 'bt', 'revision')))
# Computed at download ... # Computed at download ...
...@@ -424,7 +423,7 @@ class TestTemplateTool(ERP5TypeTestCase): ...@@ -424,7 +423,7 @@ class TestTemplateTool(ERP5TypeTestCase):
'http://www.erp5.org/dists/snapshot/bt5/erp5_base.bt5') 'http://www.erp5.org/dists/snapshot/bt5/erp5_base.bt5')
self.assertEqual(getBusinessTemplateUrl(url_list[2:], exist_bt5), self.assertEqual(getBusinessTemplateUrl(url_list[2:], exist_bt5),
'http://www.erp5.org/dists/release/5.4.5/bt5/erp5_base.bt5') 'http://www.erp5.org/dists/release/5.4.5/bt5/erp5_base.bt5')
INSTANCE_HOME = getConfiguration().instancehome INSTANCE_HOME = getConfiguration().instancehome # pylint: disable=redefined-builtin
local_bt = None local_bt = None
if os.path.exists(INSTANCE_HOME + "/bt5/erp5_base"): if os.path.exists(INSTANCE_HOME + "/bt5/erp5_base"):
local_bt = 'file://' + INSTANCE_HOME + "/bt5/erp5_base" local_bt = 'file://' + INSTANCE_HOME + "/bt5/erp5_base"
...@@ -799,11 +798,11 @@ class TestTemplateTool(ERP5TypeTestCase): ...@@ -799,11 +798,11 @@ class TestTemplateTool(ERP5TypeTestCase):
copyTestCoreBt("bt5") copyTestCoreBt("bt5")
# create bt1..5 BT inside dummy_repository # create bt1..5 BT inside dummy_repository
repo_xml = getDOMImplementation().createDocument(None, "repository", None) repo_xml = getDOMImplementation().createDocument(None, "repository", None)
createBtAndAddToRepository(repository, repo_xml, title='bt1', dependency_list=('bt4',)), createBtAndAddToRepository(repository, repo_xml, title='bt1', dependency_list=('bt4',))
createBtAndAddToRepository(repository, repo_xml, title='bt2'), createBtAndAddToRepository(repository, repo_xml, title='bt2')
createBtAndAddToRepository(repository, repo_xml, title='bt3'), createBtAndAddToRepository(repository, repo_xml, title='bt3')
createBtAndAddToRepository(repository, repo_xml, title='bt4'), createBtAndAddToRepository(repository, repo_xml, title='bt4')
createBtAndAddToRepository(repository, repo_xml, title='bt5'), createBtAndAddToRepository(repository, repo_xml, title='bt5')
with open("%s/bt5list" % repository,"wb") as repo_xml_fd: with open("%s/bt5list" % repository,"wb") as repo_xml_fd:
repo_xml.writexml(repo_xml_fd) repo_xml.writexml(repo_xml_fd)
repo_xml_fd.close() repo_xml_fd.close()
......
<?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>default_reference</string> </key>
<value> <string>testTemplateTool</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.tests.testTemplateTool</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testTemplateTool</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">AAAAAAAAAAI=</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>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
test.erp5.testBug test.erp5.testBug
test.erp5.testERP5Toolbox test.erp5.testERP5Toolbox
\ No newline at end of file test.erp5.testTemplateTool
\ No newline at end of file
...@@ -3,4 +3,6 @@ erp5_full_text_mroonga_catalog ...@@ -3,4 +3,6 @@ erp5_full_text_mroonga_catalog
erp5_pdm erp5_pdm
erp5_simulation erp5_simulation
erp5_trade erp5_trade
erp5_project erp5_project
\ No newline at end of file erp5_core_proxy_field_legacy
erp5_csv_style
\ No newline at end of file
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