Commit 13a1d8ea authored by Romain Courteaud's avatar Romain Courteaud

Fix encoding usage in setConnectionXml

parent f437c484
......@@ -1152,16 +1152,16 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
slave_reference = self.start_requested_slave_instance.getReference()
connection_xml = """<marshal>
<dictionary id="i2">
<string>p1</string>
<string>v1</string>
<string>p2</string>
<string>v2</string>
<unicode>p1é</unicode>
<unicode>v1é</unicode>
<unicode>p2é</unicode>
<unicode>v2é</unicode>
</dictionary>
</marshal>"""
stored_xml = """<?xml version='1.0' encoding='utf-8'?>
<instance>
<parameter id="p2">v2</parameter>
<parameter id="p1">v1</parameter>
<parameter id="p1é">v1é</parameter>
<parameter id="p2é">v2é</parameter>
</instance>
"""
self.login(self.start_requested_software_instance.getReference())
......@@ -1185,16 +1185,16 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
portal_type='Computer Partition').getReference()
connection_xml = """<marshal>
<dictionary id="i2">
<string>p1</string>
<string>v1</string>
<string>p2</string>
<string>v2</string>
<unicode>p1é</unicode>
<unicode>v1é</unicode>
<unicode>p2é</unicode>
<unicode>v2é</unicode>
</dictionary>
</marshal>"""
stored_xml = """<?xml version='1.0' encoding='utf-8'?>
<instance>
<parameter id="p2">v2</parameter>
<parameter id="p1">v1</parameter>
<parameter id="p1é">v1é</parameter>
<parameter id="p2é">v2é</parameter>
</instance>
"""
self.login(self.start_requested_software_instance.getReference())
......
26
\ No newline at end of file
27
\ No newline at end of file
......@@ -1047,8 +1047,6 @@ class SlapTool(BaseTool):
connection_xml)
instance = etree.Element('instance')
for parameter_id, parameter_value in partition_parameter_kw.iteritems():
# cast everything to string
parameter_value = str(parameter_value)
etree.SubElement(instance, "parameter",
attrib={'id':parameter_id}).text = parameter_value
connection_xml = etree.tostring(instance, pretty_print=True,
......
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