Commit 0fdd241a authored by Kazuhiko's avatar Kazuhiko

Add a test to check whether update of a part of repeated elements works.

parent ac8d33af
......@@ -1184,6 +1184,39 @@ class TestERP5Diff(unittest.TestCase):
</xupdate:modifications>
"""
def test_part_of_repeated_elements_updated(self):
"""32. Update a part of repeated elements
"""
old_xml = """<erp5>
<object portal_type="Text" gid="0123456789">
<base_data type="data">
<block_data>a</block_data>
<block_data>b</block_data>
<block_data>b</block_data>
<block_data>b</block_data>
<block_data>c</block_data>
</base_data>
</object>
</erp5>
"""
new_xml = """<erp5>
<object portal_type="Text" gid="0123456789">
<base_data type="data">
<block_data>a</block_data>
<block_data>d</block_data>
<block_data>b</block_data>
<block_data>b</block_data>
<block_data>c</block_data>
</base_data>
</object>
</erp5>
"""
expected_result_string = """<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:update select="/erp5/object[@gid='0123456789']/base_data/block_data[2]">d</xupdate:update>
</xupdate:modifications>
"""
self._assertERP5DiffWorks(old_xml, new_xml, expected_result_string)
if __name__ == '__main__':
......
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