Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5diff
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
erp5diff
Commits
ac8d33af
Commit
ac8d33af
authored
Dec 16, 2011
by
Arnaud Fontaine
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test to check whether insert-{before,after} with same ids is working fine.
parent
bf3d3747
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
0 deletions
+74
-0
src/tests/erp5diff_test_suite.py
src/tests/erp5diff_test_suite.py
+74
-0
No files found.
src/tests/erp5diff_test_suite.py
View file @
ac8d33af
...
@@ -1112,5 +1112,79 @@ class TestERP5Diff(unittest.TestCase):
...
@@ -1112,5 +1112,79 @@ class TestERP5Diff(unittest.TestCase):
"""
"""
self
.
_assertERP5DiffWorks
(
old_xml
,
new_xml
,
expected_result_string
)
self
.
_assertERP5DiffWorks
(
old_xml
,
new_xml
,
expected_result_string
)
def
test_insert_element_with_same_id
(
self
):
"""31. Insert elements with the same ids with the proper
indexes
"""
old_xml
=
"""<erp5>
<object portal_type="Person" id="313730">
<workflow_action id="edit_workflow">
<time type="date">2011/11/22 18:12:58.767616 GMT+9</time>
</workflow_action>
<workflow_action id="edit_workflow">
<time type="date">2011/11/22 18:13:0.092858 GMT+9</time>
</workflow_action>
<workflow_action id="edit_workflow">
<time type="date">2011/11/22 18:13:4.909007 GMT+9</time>
</workflow_action>
</object>
</erp5>
"""
new_xml
=
"""<erp5>
<object portal_type="Person" id="313730">
<workflow_action id="edit_workflow">
<time type="date">2011/11/22 18:06:58.767616 GMT+9</time>
</workflow_action>
<workflow_action id="edit_workflow">
<time type="date">2011/11/22 18:12:58.767616 GMT+9</time>
</workflow_action>
<workflow_action id="edit_workflow">
<time type="date">2011/11/22 18:13:0.092858 GMT+9</time>
</workflow_action>
<workflow_action id="edit_workflow">
<time type="date">2011/11/22 18:13:3.767616 GMT+9</time>
</workflow_action>
<workflow_action id="edit_workflow">
<time type="date">2011/11/22 18:13:4.909007 GMT+9</time>
</workflow_action>
<workflow_action id="edit_workflow">
<time type="date">2011/11/22 18:13:4.999999 GMT+9</time>
</workflow_action>
<workflow_action id="edit_workflow">
<time type="date">2011/11/22 18:13:14.767616 GMT+9</time>
</workflow_action>
</object>
</erp5>
"""
expected_result_string
=
"""<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
<xupdate:insert-before select="/erp5/object[@id='313730']/workflow_action[@id='edit_workflow'][1]">
<xupdate:element name="workflow_action">
<xupdate:attribute name="id">edit_workflow</xupdate:attribute>
<time type="date">2011/11/22 18:06:58.767616 GMT+9</time>
</xupdate:element>
</xupdate:insert-before>
<xupdate:insert-before select="/erp5/object[@id='313730']/workflow_action[@id='edit_workflow'][4]">
<xupdate:element name="workflow_action">
<xupdate:attribute name="id">edit_workflow</xupdate:attribute>
<time type="date">2011/11/22 18:13:3.767616 GMT+9</time>
</xupdate:element>
</xupdate:insert-before>
<xupdate:insert-after select="/erp5/object[@id='313730']/workflow_action[@id='edit_workflow'][5]">
<xupdate:element name="workflow_action">
<xupdate:attribute name="id">edit_workflow</xupdate:attribute>
<time type="date">2011/11/22 18:13:4.999999 GMT+9</time>
</xupdate:element>
<xupdate:element name="workflow_action">
<xupdate:attribute name="id">edit_workflow</xupdate:attribute>
<time type="date">2011/11/22 18:13:14.767616 GMT+9</time>
</xupdate:element>
</xupdate:insert-after>
</xupdate:modifications>
"""
self
.
_assertERP5DiffWorks
(
old_xml
,
new_xml
,
expected_result_string
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
.
main
()
Jérome Perrin
@jerome
mentioned in commit
30e6d520
·
Sep 14, 2022
mentioned in commit
30e6d520
mentioned in commit 30e6d52023f24ea4bec9a2496f6a8a3a7f7df020
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment