Commit 4645e7b4 authored by Arnaud Fontaine's avatar Arnaud Fontaine

WIP: ZODB Components: Migrate ERP5OOo Product from filesystem (Unit Tests).

parent 098a9c69
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
import os import os
import unittest import unittest
import Products.ERP5
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5.Document.Document import ConversionError from Products.ERP5.Document.Document import ConversionError
...@@ -43,7 +44,7 @@ class TestOoodResponse(ERP5TypeTestCase): ...@@ -43,7 +44,7 @@ class TestOoodResponse(ERP5TypeTestCase):
def getTitle(self): def getTitle(self):
return "TestOOoBatchMode" return "TestOOoBatchMode"
def login(self): def login(self, *args, **kw):
uf = self.getPortal().acl_users uf = self.getPortal().acl_users
uf._doAddUser(self.manager_username, self.manager_password, ['Manager'], []) uf._doAddUser(self.manager_username, self.manager_password, ['Manager'], [])
user = uf.getUserById(self.manager_username).__of__(uf) user = uf.getUserById(self.manager_username).__of__(uf)
...@@ -59,8 +60,8 @@ class TestOoodResponse(ERP5TypeTestCase): ...@@ -59,8 +60,8 @@ class TestOoodResponse(ERP5TypeTestCase):
if pref.getPreferenceState() != 'disabled': if pref.getPreferenceState() != 'disabled':
pref.disable() pref.disable()
portal_skins = self.getSkinsTool() portal_skins = self.getSkinsTool()
import_file_path = os.path.join(os.path.dirname(__file__), import_file_path = os.path.join(os.path.dirname(Products.ERP5.__file__),
'test_document', 'test_data',
'REF-en-001.odt')# Any text document will 'REF-en-001.odt')# Any text document will
# feet our needs # feet our needs
import_file = open(import_file_path, 'rb') import_file = open(import_file_path, 'rb')
......
<?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>testOOoBatchMode</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5OOo.tests.testOOoBatchMode</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testOOoBatchMode</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>
...@@ -29,6 +29,7 @@ test.erp5.testLocalizer ...@@ -29,6 +29,7 @@ test.erp5.testLocalizer
test.erp5.testMemcachedTool test.erp5.testMemcachedTool
test.erp5.testNotificationMessageModule test.erp5.testNotificationMessageModule
test.erp5.testNotificationTool test.erp5.testNotificationTool
test.erp5.testOOoBatchMode
test.erp5.testPerson test.erp5.testPerson
test.erp5.testQueryModule test.erp5.testQueryModule
test.erp5.testRestrictedPythonSecurity test.erp5.testRestrictedPythonSecurity
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<TITLE></TITLE>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="generator" content="pdftohtml 0.36">
<META name="author" content="">
<META name="keywords" content="">
<META name="date" content="2007-04-03T14:42:32+00:00">
<META name="subject" content="">
</HEAD>
<FRAMESET cols="100,*">
<FRAME name="links" src="TEST-en-002_ind.html">
<FRAME name="contents" src="TEST-en-002s.html">
</FRAMESET>
</HTML>
This is a very interesting document. It contains something special, namely a magic keyword. It also has an embedded meta information: function:musician/wind/saxophone
\ No newline at end of file
This diff is collapsed.
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