Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Noah Brackenbury
erp5
Commits
d8649077
Commit
d8649077
authored
Jan 09, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_prototype: Add test for conflict from file at same path
parent
b1f0fe8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
bt5/erp5_business_package/TestTemplateItem/portal_components/test.erp5.testBusinessPackage.py
...teItem/portal_components/test.erp5.testBusinessPackage.py
+47
-0
No files found.
bt5/erp5_business_package/TestTemplateItem/portal_components/test.erp5.testBusinessPackage.py
View file @
d8649077
...
...
@@ -201,3 +201,50 @@ class TestBusinessPackage(ERP5TypeTestCase):
self
.
assertIsNotNone
(
self
.
portal
.
restrictedTraverse
(
file_path
))
document
=
self
.
portal
.
restrictedTraverse
(
file_path
)
self
.
assertEquals
(
document
.
title
,
document_file
.
title
)
def
test_AddConflictedFileAtSamePathViaTwoPackages
(
self
):
"""
Test the result of conflict of two files to be installed at same path
by two different Business Packages
"""
old_package
=
self
.
_createBusinessPackage
()
new_package
=
self
.
_createBusinessPackage
()
document_file
=
self
.
portal
.
document_module
.
newContent
(
portal_type
=
'File'
,
title
=
'Test Document'
,
reference
=
'erp5-package.Test.Document.Two.BP'
,
data
=
'test file'
,
content_type
=
None
)
self
.
tic
()
file_path
=
document_file
.
getRelativeUrl
()
old_package
.
edit
(
template_path_list
=
[
file_path
,])
# Build the first package
self
.
_buildAndExportBusinessPackage
(
old_package
)
self
.
tic
()
# Change something in the document file
document_file
.
edit
(
data
=
'Voila, we place with conflict'
)
self
.
tic
()
new_package
.
edit
(
template_path_list
=
[
file_path
,])
# Build the second package
self
.
_buildAndExportBusinessPackage
(
new_package
)
self
.
tic
()
# Get installation data from the list of packages which we want to install
package_list
=
[
old_package
,
new_package
]
final_data
,
conflicted_data
=
createInstallationData
(
package_list
)
# Delete document from site
self
.
portal
.
document_module
.
manage_delObjects
([
document_file
.
getId
(),])
self
.
tic
()
# Assert that the final data is empty and conflicted data contains \
# two different versions of the file
self
.
assertFalse
(
final_data
)
self
.
assertTrue
(
conflicted_data
)
self
.
assertEquals
(
len
(
conflicted_data
[
file_path
]),
2
)
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