[Erp5-report] r14660 - in /erp5/trunk/products/ERP5SyncML: ./ Conduit/ dtml/ tests/
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu May 31 17:30:34 CEST 2007
Author: seb
Date: Thu May 31 17:30:33 2007
New Revision: 14660
URL: http://svn.erp5.org?rev=14660&view=rev
Log:
do not break the start of ERP5 if the library Ft.Xml is missing, only raise ImportError when we want to use synchronization tool
Modified:
erp5/trunk/products/ERP5SyncML/Conduit/ERP5Conduit.py
erp5/trunk/products/ERP5SyncML/Publication.py
erp5/trunk/products/ERP5SyncML/PublicationSynchronization.py
erp5/trunk/products/ERP5SyncML/Subscription.py
erp5/trunk/products/ERP5SyncML/SubscriptionSynchronization.py
erp5/trunk/products/ERP5SyncML/SyncCode.py
erp5/trunk/products/ERP5SyncML/SynchronizationTool.py
erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py
erp5/trunk/products/ERP5SyncML/dtml/managePublications.dtml
erp5/trunk/products/ERP5SyncML/dtml/manageSubscriptions.dtml
erp5/trunk/products/ERP5SyncML/dtml/manage_addPublication.dtml
erp5/trunk/products/ERP5SyncML/dtml/manage_addSubscription.dtml
erp5/trunk/products/ERP5SyncML/tests/testERP5SyncML.py
Modified: erp5/trunk/products/ERP5SyncML/Conduit/ERP5Conduit.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/Conduit/ERP5Conduit.py?rev=14660&r1=14659&r2=14660&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/Conduit/ERP5Conduit.py (original)
+++ erp5/trunk/products/ERP5SyncML/Conduit/ERP5Conduit.py Thu May 31 17:30:33 2007
@@ -33,7 +33,7 @@
from Products.ERP5SyncML.XupdateUtils import XupdateUtils
from Products.ERP5Type.Utils import convertToUpperCase
from Products.ERP5Type.Accessor.TypeDefinition import list_types
-from Ft.Xml import Parse
+from Products.ERP5SyncML.XMLSyncUtils import Parse
from DateTime.DateTime import DateTime
from email.MIMEBase import MIMEBase
from email import Encoders
@@ -47,11 +47,19 @@
from xml.sax.saxutils import escape, unescape
import re, copy
import cStringIO
-from Ft.Xml.Domlette import Print, PrettyPrint
-
-
from zLOG import LOG
+try:
+ from Ft.Xml.Domlette import Print, PrettyPrint
+except ImportError:
+ LOG('ERP5Conduit',0,"Can't import Print and PrettyPrint")
+ class Print:
+ def __init__(self, *args, **kw):
+ raise ImportError, "Sorry, it was not possible to import Ft library"
+
+ class PrettyPrint:
+ def __init__(self, *args, **kw):
+ raise ImportError, "Sorry, it was not possible to import Ft library"
class ERP5Conduit(XMLSyncUtilsMixin):
"""
Modified: erp5/trunk/products/ERP5SyncML/Publication.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/Publication.py?rev=14660&r1=14659&r2=14660&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/Publication.py (original)
+++ erp5/trunk/products/ERP5SyncML/Publication.py Thu May 31 17:30:33 2007
@@ -153,8 +153,8 @@
# Constructor
def __init__(self, id, title, publication_url, destination_path,
- query, xml_mapping, conduit, gpg_key, id_generator, gid_generator,
- flow_type, auth_required=False, authentication_format='',
+ query, xml_mapping, conduit, gpg_key, id_generator, gid_generator,
+ media_type, auth_required=False, authentication_format='',
authentication_type=''):
"""
constructor
@@ -168,7 +168,7 @@
self.domain_type = self.PUB
self.gpg_key = gpg_key
self.setGidGenerator(gid_generator)
- self.setFlowType(flow_type)
+ self.setMediaType(media_type)
self.setSynchronizationIdGenerator(id_generator)
self.setConduit(conduit)
Folder.__init__(self, id)
Modified: erp5/trunk/products/ERP5SyncML/PublicationSynchronization.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/PublicationSynchronization.py?rev=14660&r1=14659&r2=14660&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/PublicationSynchronization.py (original)
+++ erp5/trunk/products/ERP5SyncML/PublicationSynchronization.py Thu May 31 17:30:33 2007
@@ -29,7 +29,7 @@
import smtplib # to send emails
from Publication import Publication,Subscriber
from Subscription import Signature
-from Ft.Xml import Parse
+from XMLSyncUtils import Parse
from XMLSyncUtils import XMLSyncUtils
from Conduit.ERP5Conduit import ERP5Conduit
from Products.CMFCore.utils import getToolByName
Modified: erp5/trunk/products/ERP5SyncML/Subscription.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/Subscription.py?rev=14660&r1=14659&r2=14660&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/Subscription.py (original)
+++ erp5/trunk/products/ERP5SyncML/Subscription.py Thu May 31 17:30:33 2007
@@ -644,7 +644,7 @@
# Constructor
def __init__(self, id, title, publication_url, subscription_url,
destination_path, query, xml_mapping, conduit, gpg_key, id_generator,
- gid_generator, flow_type, login, password):
+ gid_generator, media_type, login, password):
"""
We need to create a dictionnary of
signatures of documents which belong to the synchronisation
@@ -661,7 +661,7 @@
#self.signatures = PersistentMapping()
self.last_anchor = '00000000T000000Z'
self.next_anchor = '00000000T000000Z'
- self.flow_type = flow_type
+ self.setMediaType(media_type)
self.login = login
self.password=password
self.domain_type = self.SUB
@@ -884,19 +884,20 @@
"""
return self.gid_generator
- def getFlowType(self):
- """
- This method return the type of the data within the xml message :
- - text for VCard's
- - xml for others
- """
- return getattr(self, 'flow_type', 'xml')
-
- def setFlowType(self, flow_type):
- """
- set the flow type (xml or text)
- """
- self.flow_type=flow_type
+ def getMediaType(self):
+ """
+ This method return the type of media used in this session,
+ for example, it could be "text/vcard" or "xml/text",...
+ """
+ return getattr(self, 'media_type', self.MEDIA_TYPE['TEXT_XML'])
+
+ def setMediaType(self, media_type):
+ """
+ set the type of media used
+ """
+ if media_type in (None,''):
+ media_type = self.MEDIA_TYPE['TEXT_XML']
+ self.media_type = media_type
def getLogin(self):
"""
Modified: erp5/trunk/products/ERP5SyncML/SubscriptionSynchronization.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/SubscriptionSynchronization.py?rev=14660&r1=14659&r2=14660&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/SubscriptionSynchronization.py (original)
+++ erp5/trunk/products/ERP5SyncML/SubscriptionSynchronization.py Thu May 31 17:30:33 2007
@@ -28,8 +28,7 @@
import smtplib # to send emails
from Subscription import Subscription,Signature
-from Ft.Xml import Parse
-from XMLSyncUtils import XMLSyncUtils
+from XMLSyncUtils import XMLSyncUtils, Parse
import commands
from Conduit.ERP5Conduit import ERP5Conduit
from zLOG import LOG
Modified: erp5/trunk/products/ERP5SyncML/SyncCode.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/SyncCode.py?rev=14660&r1=14659&r2=14660&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/SyncCode.py (original)
+++ erp5/trunk/products/ERP5SyncML/SyncCode.py Thu May 31 17:30:33 2007
@@ -110,3 +110,10 @@
bad_history_exp = "/%s\[@id='.*'\]/" % history_tag
local_role_and_group_list = (local_group_exp,local_role_exp)
bad_local_role_and_group_list = (bad_local_group_exp,bad_local_role_exp)
+
+
+ #media types :
+
+ MEDIA_TYPE = {}
+ MEDIA_TYPE['TEXT_XML'] = 'text/xml'
+ MEDIA_TYPE['TEXT_VCARD'] = 'text/vcard'
Modified: erp5/trunk/products/ERP5SyncML/SynchronizationTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/SynchronizationTool.py?rev=14660&r1=14659&r2=14660&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/SynchronizationTool.py (original)
+++ erp5/trunk/products/ERP5SyncML/SynchronizationTool.py Thu May 31 17:30:33 2007
@@ -40,7 +40,8 @@
from Publication import Publication,Subscriber
from Products.BTreeFolder2.BTreeFolder2 import BTreeFolder2
from Subscription import Subscription,Signature
-from Ft.Xml import Parse
+from XMLSyncUtils import Parse
+#from Ft.Xml import Parse
from Products.ERP5Type import Permissions
from PublicationSynchronization import PublicationSynchronization
from SubscriptionSynchronization import SubscriptionSynchronization
@@ -162,7 +163,7 @@
def manage_addPublication(self, title, publication_url, destination_path,
query, xml_mapping, conduit, gpg_key,
synchronization_id_generator=None, gid_generator=None,
- flow_type='xml', auth_required=0, authentication_format='',
+ media_type=None, auth_required=0, authentication_format='',
authentication_type='', RESPONSE=None):
"""
create a new publication
@@ -174,7 +175,7 @@
new_id = self.getPublicationIdFromTitle(title)
pub = Publication(new_id, title, publication_url, destination_path,
query, xml_mapping, conduit, gpg_key,
- synchronization_id_generator, gid_generator, flow_type,
+ synchronization_id_generator, gid_generator, media_type,
auth_required, authentication_format, authentication_type)
folder._setObject( new_id, pub )
#if len(self.list_publications) == 0:
@@ -188,7 +189,7 @@
def manage_addSubscription(self, title, publication_url, subscription_url,
destination_path, query, xml_mapping, conduit, gpg_key,
synchronization_id_generator=None, gid_generator=None,
- flow_type='xml', login=None, password=None,
+ media_type=None, login=None, password=None,
RESPONSE=None):
"""
XXX should be renamed as addSubscription
@@ -201,7 +202,7 @@
new_id = self.getSubscriptionIdFromTitle(title)
sub = Subscription(new_id, title, publication_url, subscription_url,
destination_path, query, xml_mapping, conduit, gpg_key,
- synchronization_id_generator, gid_generator, flow_type,
+ synchronization_id_generator, gid_generator, media_type,
login, password)
folder._setObject( new_id, sub )
#if len(self.list_subscriptions) == 0:
@@ -215,7 +216,7 @@
def manage_editPublication(self, title, publication_url, destination_path,
query, xml_mapping, conduit, gpg_key,
synchronization_id_generator, gid_generator,
- flow_type='xml', auth_required=0,
+ media_type=None, auth_required=0,
authentication_format='', authentication_type='',
RESPONSE=None):
"""
@@ -231,7 +232,7 @@
pub.setGPGKey(gpg_key)
pub.setSynchronizationIdGenerator(synchronization_id_generator)
pub.setGidGenerator(gid_generator)
- pub.setFlowType(flow_type)
+ pub.setMediaType(media_type)
pub.setAuthentication(auth_required)
pub.setAuthenticationFormat(authentication_format)
pub.setAuthenticationType(authentication_type)
@@ -243,7 +244,7 @@
'manage_editSubscription')
def manage_editSubscription(self, title, publication_url, subscription_url,
destination_path, query, xml_mapping, conduit, gpg_key,
- synchronization_id_generator, gid_generator, flow_type='xml', login='',
+ synchronization_id_generator, gid_generator, media_type=None,login='',
password='', RESPONSE=None):
"""
modify a subscription
@@ -259,7 +260,7 @@
sub.setSubscriptionUrl(subscription_url)
sub.setSynchronizationIdGenerator(synchronization_id_generator)
sub.setGidGenerator(gid_generator)
- sub.setFlowType(flow_type)
+ sub.setMediaType(media_type)
sub.setLogin(login)
sub.setPassword(password)
if RESPONSE is not None:
Modified: erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py?rev=14660&r1=14659&r2=14660&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py (original)
+++ erp5/trunk/products/ERP5SyncML/XMLSyncUtils.py Thu May 31 17:30:33 2007
@@ -29,7 +29,6 @@
import smtplib
from Products.ERP5SyncML.SyncCode import SyncCode
from Products.ERP5SyncML.Subscription import Signature
-from Ft.Xml import Parse
from DateTime import DateTime
from cStringIO import StringIO
from xml.dom.ext import PrettyPrint
@@ -42,6 +41,13 @@
pass
import commands
from zLOG import LOG
+try:
+ from Ft.Xml import Parse
+except ImportError:
+ LOG('XMLSyncUtils',0,"Can't import Parse")
+ class Parse:
+ def __init__(self, *args, **kw):
+ raise ImportError, "Sorry, it was not possible to import Ft library"
class XMLSyncUtilsMixin(SyncCode):
@@ -191,7 +197,7 @@
server.quit()
def addXMLObject(self, cmd_id=0, object=None, xml_string=None,
- more_data=0,gid=None):
+ more_data=0,gid=None, media_type=None):
"""
Add an object with the SyncML protocol
"""
@@ -200,7 +206,7 @@
xml(' <Add>\n')
xml(' <CmdID>%s</CmdID>\n' % cmd_id)
xml(' <Meta>\n')
- xml(' <Type>%s</Type>\n' % object.portal_type)
+ xml(' <Type>%s</Type>\n' % media_type)
xml(' </Meta>\n')
xml(' <Item>\n')
xml(' <Source>\n')
@@ -236,7 +242,7 @@
return xml_a
def replaceXMLObject(self, cmd_id=0, object=None, xml_string=None,
- more_data=0,gid=None):
+ more_data=0, gid=None, media_type=None):
"""
Replace an object with the SyncML protocol
"""
@@ -245,7 +251,7 @@
xml(' <Replace>\n')
xml(' <CmdID>%s</CmdID>\n' % cmd_id)
xml(' <Meta>\n')
- xml(' <Type>%s</Type>\n' % object.portal_type)
+ xml(' <Type>%s</Type>\n' % media_type)
xml(' </Meta>\n')
xml(' <Item>\n')
xml(' <Source>\n')
@@ -663,6 +669,8 @@
status = self.SENT
#gid_generator = getattr(object,domain.getGidGenerator(),None)
object_gid = domain.getGidFromObject(object)
+ if object_gid in ('', None):
+ continue;
local_gid_list += [object_gid]
#if gid_generator is not None:
# object_gid = gid_generator()
@@ -670,7 +678,6 @@
if syncml_data.count('\n') < self.MAX_LINES and not \
object.id.startswith('.'): # If not we have to cut
#LOG('getSyncMLData',0,'xml_mapping: %s' % str(domain.xml_mapping))
- #LOG('getSyncMLData', 0, 'FlowType: %s' % str(subscriber.getFlowType()))
#LOG('getSyncMLData',0,'code: %s' % str(self.getAlertCode(remote_xml)))
#LOG('getSyncMLData',0,'gid_list: %s' % str(local_gid_list))
#LOG('getSyncMLData',0,'hasSignature: %s' % str(subscriber.hasSignature(object_gid)))
@@ -712,7 +719,8 @@
signature.setAction('Add')
xml_string = '<!--' + short_string + '-->'
syncml_data += self.addXMLObject(cmd_id=cmd_id, object=object,
- gid=object_gid, xml_string=xml_string, more_data=more_data)
+ gid=object_gid, xml_string=xml_string, more_data=more_data,
+ media_type=subscriber.getMediaType())
cmd_id += 1
signature.setStatus(status)
subscriber.addSignature(signature)
@@ -748,11 +756,12 @@
signature.setAction('Replace')
xml_string = '<!--' + short_string + '-->'
signature.setStatus(status)
- if(subscriber.getFlowType() == 'text'):
+ if subscriber.getMediaType() != self.MEDIA_TYPE['TEXT_XML']:
xml_string = self.getXMLObject(object=object,
xml_mapping=domain.xml_mapping)
syncml_data += self.replaceXMLObject(cmd_id=cmd_id, object=object,
- gid=object_gid, xml_string=xml_string, more_data=more_data)
+ gid=object_gid, xml_string=xml_string, more_data=more_data,
+ media_type=subscriber.getMediaType())
cmd_id += 1
signature.setTempXML(xml_object)
# Now we can apply the xupdate from the subscriber
@@ -771,7 +780,7 @@
signature.setStatus(self.SYNCHRONIZED)
elif signature.getStatus()==self.PUB_CONFLICT_CLIENT_WIN:
# We have decided to apply the update
- # XXX previous_xml will be getXML instead of getTempXML because
+ # XXX previous_xml will be geXML instead of getTempXML because
# some modification was already made and the update
# may not apply correctly
xml_update = signature.getPartialXML()
@@ -798,16 +807,18 @@
xml_string = xml_string.replace('--','@-@@-@')
xml_string = '<!--' + xml_string + '-->'
signature.setStatus(status)
- if(subscriber.getFlowType() == 'text'):
+ if(subscriber.getMediaType() != self.MEDIA_TYPE['TEXT_XML']):
xml_string = self.getXMLObject(object=object,
xml_mapping=domain.xml_mapping)
LOG('xml_string =', 0, xml_string)
if signature.getAction()=='Replace':
syncml_data += self.replaceXMLObject(cmd_id=cmd_id, object=object,
- gid=object_gid, xml_string=xml_string, more_data=more_data)
+ gid=object_gid, xml_string=xml_string, more_data=more_data,
+ media_type=subscriber.getMediaType())
elif signature.getAction()=='Add':
syncml_data += self.addXMLObject(cmd_id=cmd_id, object=object,
- gid=object_gid, xml_string=xml_string, more_data=more_data)
+ gid=object_gid, xml_string=xml_string, more_data=more_data,
+ media_type=subscriber.getMediaType())
return (syncml_data,xml_confirmation,cmd_id)
def applyActionList(self, domain=None, subscriber=None,destination_path=None,
@@ -846,12 +857,12 @@
data_subnode = partial_data
LOG('SyncModif',0,'data_subnode: %s' % data_subnode)
#data_subnode = FromXml(data_subnode)
- if subscriber.getFlowType() == 'xml':
+ if subscriber.getMediaType() == self.MEDIA_TYPE['TEXT_XML']:
data_subnode = Parse(data_subnode)
data_subnode = data_subnode.childNodes[0] # Because we just created a new xml
# document, with childNodes[0] a DocumentType and childNodes[1] the Element Node
else:
- if subscriber.getFlowType() == 'text':
+ if subscriber.getMediaType() != self.MEDIA_TYPE['TEXT_XML']:
data_subnode = self.getDataText(next_action)
else:
data_subnode = self.getDataSubNode(next_action)
@@ -934,7 +945,7 @@
elif next_action.nodeName == 'Delete':
object_id = signature.getId()
- if subscriber.getFlowType == 'text':
+ if subscriber.getMediaType() != self.MEDIA_TYPE['TEXT_XML']:
data_subnode = self.getDataText(next_action)
else:
data_subnode = self.getDataSubNode(next_action)
Modified: erp5/trunk/products/ERP5SyncML/dtml/managePublications.dtml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/dtml/managePublications.dtml?rev=14660&r1=14659&r2=14660&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/dtml/managePublications.dtml (original)
+++ erp5/trunk/products/ERP5SyncML/dtml/managePublications.dtml Thu May 31 17:30:33 2007
@@ -130,19 +130,11 @@
<tr>
<td align="left" valign="top">
<div class="form-label">
- Flow Type
+ Media Type
</label></div>
</td>
<td align="left" valign="top">
- <SELECT name="flow_type" size="1">
- <dtml-if expr="getFlowType() != 'text'">
- <OPTION value="xml" selected>XML</option>
- <OPTION value="text">text</option>
- <dtml-else>
- <OPTION value="xml">XML</option>
- <OPTION value="text" selected>text</option>
- </dtml-if>
- </SELECT>
+ <input type="text" name="media_type" value="<dtml-var getMediaType>" size="40" />
</td>
</tr>
<tr>
Modified: erp5/trunk/products/ERP5SyncML/dtml/manageSubscriptions.dtml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/dtml/manageSubscriptions.dtml?rev=14660&r1=14659&r2=14660&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/dtml/manageSubscriptions.dtml (original)
+++ erp5/trunk/products/ERP5SyncML/dtml/manageSubscriptions.dtml Thu May 31 17:30:33 2007
@@ -140,19 +140,11 @@
<tr>
<td align="left" valign="top">
<div class="form-label">
- Flow Type
+ Media Type
</label></div>
</td>
<td align="left" valign="top">
- <SELECT name="flow_type" size="1">
- <dtml-if expr="getFlowType() != 'text'">
- <OPTION value="xml" selected>XML</option>
- <OPTION value="text">text</option>
- <dtml-else>
- <OPTION value="xml">XML</option>
- <OPTION value="text" selected>text</option>
- </dtml-if>
- </SELECT>
+ <input type="text" name="media_type" value="<dtml-var getMediaType>" size="40" />
</td>
</tr>
<tr>
Modified: erp5/trunk/products/ERP5SyncML/dtml/manage_addPublication.dtml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/dtml/manage_addPublication.dtml?rev=14660&r1=14659&r2=14660&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/dtml/manage_addPublication.dtml (original)
+++ erp5/trunk/products/ERP5SyncML/dtml/manage_addPublication.dtml Thu May 31 17:30:33 2007
@@ -126,14 +126,11 @@
<tr>
<td align="left" valign="top">
<div class="form-label">
- Flow Type
+ Media Type
</label></div>
</td>
<td align="left" valign="top">
- <SELECT name="flow_type" size="1">
- <OPTION value="xml" selected>XML</option>
- <OPTION value="text">text</option>
- </SELECT>
+ <input type="text" name="media_type" size="40" />
</td>
</tr>
<tr>
Modified: erp5/trunk/products/ERP5SyncML/dtml/manage_addSubscription.dtml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/dtml/manage_addSubscription.dtml?rev=14660&r1=14659&r2=14660&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/dtml/manage_addSubscription.dtml (original)
+++ erp5/trunk/products/ERP5SyncML/dtml/manage_addSubscription.dtml Thu May 31 17:30:33 2007
@@ -136,14 +136,11 @@
<tr>
<td align="left" valign="top">
<div class="form-label">
- Flow Type
+ Media Type
</label></div>
</td>
<td align="left" valign="top">
- <SELECT name="flow_type" size="1">
- <OPTION value="xml" selected>XML</option>
- <OPTION value="text">text</option>
- </SELECT>
+ <input type="text" name="media_type" size="40" />
</td>
</tr>
<tr>
Modified: erp5/trunk/products/ERP5SyncML/tests/testERP5SyncML.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/tests/testERP5SyncML.py?rev=14660&r1=14659&r2=14660&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/tests/testERP5SyncML.py (original)
+++ erp5/trunk/products/ERP5SyncML/tests/testERP5SyncML.py Thu May 31 17:30:33 2007
@@ -741,11 +741,11 @@
person1 = person_server._getOb(self.id1)
sub_person1 = person1.newContent(id=self.id1,portal_type='Person')
kw = {'first_name':self.first_name1,'last_name':self.last_name1,
- 'description':self.description1}
+ 'description':self.description1}
sub_person1.edit(**kw)
sub_sub_person1 = sub_person1.newContent(id=self.id1,portal_type='Person')
kw = {'first_name':self.first_name1,'last_name':self.last_name1,
- 'description':self.description1}
+ 'description':self.description1, 'default_telephone_text':'0689778308'}
sub_sub_person1.edit(**kw)
sub_sub_person2 = sub_person1.newContent(id=self.id2,portal_type='Person')
kw = {'first_name':self.first_name2,'last_name':self.last_name2,
@@ -785,6 +785,7 @@
self.failUnless(sub_sub_person1.getDescription()==self.description1)
self.failUnless(sub_sub_person1.getFirstName()==self.first_name1)
self.failUnless(sub_sub_person1.getLastName()==self.last_name1)
+ self.failUnless(sub_sub_person1.getDefaultTelephoneText()=='+(0)-0689778308')
self.failUnless(sub_sub_person2.getDescription()==self.description2)
self.failUnless(sub_sub_person2.getFirstName()==self.first_name2)
self.failUnless(sub_sub_person2.getLastName()==self.last_name2)
More information about the Erp5-report
mailing list