Commit e345147a authored by Nicolas Delaby's avatar Nicolas Delaby

Add a test to prove recent modification

- (Comments and PI as sibling)
- New nodes stay orphan.
parent 3cc702ba
......@@ -1000,5 +1000,44 @@ does not work as bellow example. This is a known bug.
<xupdate:remove xmlns:marshal="http://www.erp5.org/namespaces/marshaller" select="/object/local_permission[@id='View']/marshal:marshal/marshal:tuple/marshal:string[2]"/>
</xupdate:modifications>
30. Replace a node by another one following by a modification
>>> old_xml = """
... <resource reference="Product Ballon de Plage a5962z">
... <title>Ballon de Plage</title>
... <reference>a5962z</reference>
... <sale_price>200.250000</sale_price>
... <purchase_price>100.250000</purchase_price>
... <category>ball_size/s4</category>
... <category>ball_size/s5</category>
... <category>colour/black</category>
... <category>colour/white</category>
... <category>type/product</category>
... </resource>
... """
>>> new_xml = """
... <resource reference="Product Ballon de Plage a5962z">
... <title>Ballon de Plage</title>
... <reference>a5962z</reference>
... <sale_price>120.000000</sale_price>
... <ean13>1357913579130</ean13><!--replace purchase_price -->
... <category>ball_size/s4</category>
... <category>ball_size/s6</category><!--first modification to trig the bug -->
... <category>colour/red</category>
... <category>colour/white</category>
... <category>type/product</category>
... </resource>
... """
>>> erp5diff.compare(old_xml, new_xml)
>>> erp5diff.output()
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:update select="/resource/sale_price">120.000000</xupdate:update>
<xupdate:remove select="/resource/purchase_price"/>
<xupdate:update select="/resource/category[2]">ball_size/s6</xupdate:update>
<xupdate:update select="/resource/category[3]">colour/red</xupdate:update>
<xupdate:insert-before select="/resource/category[0]">
<xupdate:element name="ean13">1357913579130</xupdate:element>
</xupdate:insert-before>
</xupdate:modifications>
- 2003-12-04, Yoshinori OKUJI <yo@nexedi.com>
- 2009-09-15, Tatuya Kamada <tatuya@nexedi.com>
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