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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ludovic Kiefer
erp5
Commits
914f46fe
Commit
914f46fe
authored
Sep 17, 2019
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testCopySupport: Do not contaminate other tests in same file.
parent
0c568094
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
15 deletions
+20
-15
product/ERP5Type/tests/testCopySupport.py
product/ERP5Type/tests/testCopySupport.py
+20
-15
No files found.
product/ERP5Type/tests/testCopySupport.py
View file @
914f46fe
...
@@ -66,21 +66,26 @@ class TestCopySupport(ERP5TypeTestCase):
...
@@ -66,21 +66,26 @@ class TestCopySupport(ERP5TypeTestCase):
# Try to rename: must work
# Try to rename: must work
self
.
organisation_module
.
setId
(
'new_organisation_module'
)
self
.
organisation_module
.
setId
(
'new_organisation_module'
)
self
.
commit
()
self
.
commit
()
self
.
assertTrue
(
person
.
getCareerSubordination
().
startswith
(
'organisation_module'
))
try
:
initial_activity_count
=
len
(
self
.
portal
.
portal_activities
.
getMessageList
())
self
.
assertTrue
(
person
.
getCareerSubordination
().
startswith
(
'organisation_module'
))
self
.
assertNotEqual
(
0
,
initial_activity_count
)
initial_activity_count
=
len
(
self
.
portal
.
portal_activities
.
getMessageList
())
# Try to rename again with pending activities: must raise
self
.
assertNotEqual
(
0
,
initial_activity_count
)
self
.
assertRaises
(
ActivityPendingError
,
self
.
organisation_module
.
setId
,
'organisation_module'
)
# Try to rename again with pending activities: must raise
self
.
commit
()
self
.
assertRaises
(
ActivityPendingError
,
self
.
organisation_module
.
setId
,
'organisation_module'
)
# Activity count must not have changed
self
.
commit
()
self
.
assertEqual
(
initial_activity_count
,
len
(
self
.
portal
.
portal_activities
.
getMessageList
()))
# Activity count must not have changed
self
.
tic
()
self
.
assertEqual
(
initial_activity_count
,
len
(
self
.
portal
.
portal_activities
.
getMessageList
()))
# Check that external relation was updated
self
.
tic
()
self
.
assertTrue
(
person
.
getCareerSubordination
().
startswith
(
'new_organisation_module'
))
# Check that external relation was updated
self
.
assertTrue
(
person
.
getCareerSubordinationValue
().
aq_base
is
organisation
.
aq_base
)
self
.
assertTrue
(
person
.
getCareerSubordination
().
startswith
(
'new_organisation_module'
))
# Rename back to original name
self
.
assertTrue
(
person
.
getCareerSubordinationValue
().
aq_base
is
organisation
.
aq_base
)
self
.
organisation_module
.
setId
(
'organisation_module'
)
except
Exception
:
self
.
tic
()
self
.
abort
()
raise
finally
:
# Rename back to original name
self
.
organisation_module
.
setId
(
'organisation_module'
)
self
.
tic
()
# Check that relation is back to what it was
# Check that relation is back to what it was
self
.
assertTrue
(
person
.
getCareerSubordination
().
startswith
(
'organisation_module'
))
self
.
assertTrue
(
person
.
getCareerSubordination
().
startswith
(
'organisation_module'
))
self
.
assertTrue
(
person
.
getCareerSubordinationValue
().
aq_base
is
organisation
.
aq_base
)
self
.
assertTrue
(
person
.
getCareerSubordinationValue
().
aq_base
is
organisation
.
aq_base
)
...
...
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