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
Klaus Wölfel
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):
# Try to rename: must work
self
.
organisation_module
.
setId
(
'new_organisation_module'
)
self
.
commit
()
self
.
assertTrue
(
person
.
getCareerSubordination
().
startswith
(
'organisation_module'
))
initial_activity_count
=
len
(
self
.
portal
.
portal_activities
.
getMessageList
())
self
.
assertNotEqual
(
0
,
initial_activity_count
)
# Try to rename again with pending activities: must raise
self
.
assertRaises
(
ActivityPendingError
,
self
.
organisation_module
.
setId
,
'organisation_module'
)
self
.
commit
()
# Activity count must not have changed
self
.
assertEqual
(
initial_activity_count
,
len
(
self
.
portal
.
portal_activities
.
getMessageList
()))
self
.
tic
()
# Check that external relation was updated
self
.
assertTrue
(
person
.
getCareerSubordination
().
startswith
(
'new_organisation_module'
))
self
.
assertTrue
(
person
.
getCareerSubordinationValue
().
aq_base
is
organisation
.
aq_base
)
# Rename back to original name
self
.
organisation_module
.
setId
(
'organisation_module'
)
self
.
tic
()
try
:
self
.
assertTrue
(
person
.
getCareerSubordination
().
startswith
(
'organisation_module'
))
initial_activity_count
=
len
(
self
.
portal
.
portal_activities
.
getMessageList
())
self
.
assertNotEqual
(
0
,
initial_activity_count
)
# Try to rename again with pending activities: must raise
self
.
assertRaises
(
ActivityPendingError
,
self
.
organisation_module
.
setId
,
'organisation_module'
)
self
.
commit
()
# Activity count must not have changed
self
.
assertEqual
(
initial_activity_count
,
len
(
self
.
portal
.
portal_activities
.
getMessageList
()))
self
.
tic
()
# Check that external relation was updated
self
.
assertTrue
(
person
.
getCareerSubordination
().
startswith
(
'new_organisation_module'
))
self
.
assertTrue
(
person
.
getCareerSubordinationValue
().
aq_base
is
organisation
.
aq_base
)
except
Exception
:
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
self
.
assertTrue
(
person
.
getCareerSubordination
().
startswith
(
'organisation_module'
))
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