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
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
2bc75bf6
Commit
2bc75bf6
authored
Jan 25, 2012
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add assertHasAttribute and failIfHasAttribute to ERP5TypeTestCase.
parent
984f4616
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
product/ERP5Type/tests/ERP5TypeTestCase.py
product/ERP5Type/tests/ERP5TypeTestCase.py
+10
-0
product/ERP5Type/tests/testDynamicClassGeneration.py
product/ERP5Type/tests/testDynamicClassGeneration.py
+0
-10
No files found.
product/ERP5Type/tests/ERP5TypeTestCase.py
View file @
2bc75bf6
...
...
@@ -522,6 +522,16 @@ class ERP5TypeTestCaseMixin(ProcessingNodeTestCase, PortalTestCase):
self
.
assertEquals
(
set
(
a
),
set
(
b
),
msg
)
assertSameSet
=
failIfDifferentSet
def
assertHasAttribute
(
self
,
obj
,
attribute
,
msg
=
None
):
self
.
failIfEqual
(
None
,
getattr
(
obj
,
attribute
,
None
),
msg
or
'%s: no attribute %s'
%
(
obj
.
__name__
,
attribute
))
def
failIfHasAttribute
(
self
,
obj
,
attribute
,
msg
=
None
):
self
.
assertEquals
(
None
,
getattr
(
obj
,
attribute
,
None
),
msg
or
'%s: attribute %s present'
%
(
obj
.
__name__
,
attribute
))
def
assertWorkflowTransitionFails
(
self
,
object
,
workflow_id
,
transition_id
,
error_message
=
None
,
state_variable
=
'simulation_state'
):
"""
...
...
product/ERP5Type/tests/testDynamicClassGeneration.py
View file @
2bc75bf6
...
...
@@ -616,16 +616,6 @@ class TestZodbPropertySheet(ERP5TypeTestCase):
transaction
.
commit
()
self
.
test_module
.
getId
()
def
assertHasAttribute
(
self
,
obj
,
attribute
,
msg
=
None
):
self
.
failIfEqual
(
None
,
getattr
(
obj
,
attribute
,
None
),
msg
or
'%s: no attribute %s'
%
(
obj
.
__name__
,
attribute
))
def
failIfHasAttribute
(
self
,
obj
,
attribute
,
msg
=
None
):
self
.
assertEquals
(
None
,
getattr
(
obj
,
attribute
,
None
),
msg
or
'%s: attribute %s present'
%
(
obj
.
__name__
,
attribute
))
def
testAssignUnassignZodbPropertySheet
(
self
):
"""
From an existing portal type, assign ZODB Property Sheets and
...
...
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