Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Kirill Smelkov
Zope
Commits
706b2a37
Commit
706b2a37
authored
Jan 11, 2010
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests broken by string-exception-geddon in 2.12.
parent
7bd55cc5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
src/OFS/tests/testSimpleItem.py
src/OFS/tests/testSimpleItem.py
+13
-7
No files found.
src/OFS/tests/testSimpleItem.py
View file @
706b2a37
...
@@ -23,6 +23,9 @@ class TestItem(unittest.TestCase):
...
@@ -23,6 +23,9 @@ class TestItem(unittest.TestCase):
verifyClass
(
IManageable
,
self
.
_getTargetClass
())
verifyClass
(
IManageable
,
self
.
_getTargetClass
())
def
test_raise_StandardErrorMessage_str_errorValue
(
self
):
def
test_raise_StandardErrorMessage_str_errorValue
(
self
):
class
REQUEST
(
object
):
class
RESPONSE
(
object
):
handle_errors
=
True
item
=
self
.
_makeOne
()
item
=
self
.
_makeOne
()
def
_raise_during_standard_error_message
(
*
args
,
**
kw
):
def
_raise_during_standard_error_message
(
*
args
,
**
kw
):
raise
ZeroDivisionError
(
'testing'
)
raise
ZeroDivisionError
(
'testing'
)
...
@@ -31,17 +34,20 @@ class TestItem(unittest.TestCase):
...
@@ -31,17 +34,20 @@ class TestItem(unittest.TestCase):
item
.
raise_standardErrorMessage
(
item
.
raise_standardErrorMessage
(
error_type
=
OverflowError
,
error_type
=
OverflowError
,
error_value
=
'simple'
,
error_value
=
'simple'
,
REQUEST
=
{
'dummy'
:
''
}
,
REQUEST
=
REQUEST
()
,
)
)
except
:
except
:
import
sys
import
sys
self
.
assertEqual
(
sys
.
exc_info
()[
0
],
'OverflowError'
)
self
.
assertEqual
(
sys
.
exc_info
()[
0
],
OverflowError
)
value
=
sys
.
exc_info
()[
1
]
value
=
sys
.
exc_info
()[
1
]
self
.
failUnless
(
value
.
startswith
(
"'simple'"
))
self
.
failUnless
(
value
.
message
.
startswith
(
"'simple'"
))
self
.
failUnless
(
'full details: testing'
in
value
)
self
.
failUnless
(
'full details: testing'
in
value
.
message
)
def
test_raise_StandardErrorMessage_TaintedString_errorValue
(
self
):
def
test_raise_StandardErrorMessage_TaintedString_errorValue
(
self
):
from
ZPublisher.TaintedString
import
TaintedString
from
ZPublisher.TaintedString
import
TaintedString
class
REQUEST
(
object
):
class
RESPONSE
(
object
):
handle_errors
=
True
item
=
self
.
_makeOne
()
item
=
self
.
_makeOne
()
def
_raise_during_standard_error_message
(
*
args
,
**
kw
):
def
_raise_during_standard_error_message
(
*
args
,
**
kw
):
raise
ZeroDivisionError
(
'testing'
)
raise
ZeroDivisionError
(
'testing'
)
...
@@ -50,13 +56,13 @@ class TestItem(unittest.TestCase):
...
@@ -50,13 +56,13 @@ class TestItem(unittest.TestCase):
item
.
raise_standardErrorMessage
(
item
.
raise_standardErrorMessage
(
error_type
=
OverflowError
,
error_type
=
OverflowError
,
error_value
=
TaintedString
(
'<simple>'
),
error_value
=
TaintedString
(
'<simple>'
),
REQUEST
=
{
'dummy'
:
''
}
,
REQUEST
=
REQUEST
()
,
)
)
except
:
except
:
import
sys
import
sys
self
.
assertEqual
(
sys
.
exc_info
()[
0
],
'OverflowError'
)
self
.
assertEqual
(
sys
.
exc_info
()[
0
],
OverflowError
)
value
=
sys
.
exc_info
()[
1
]
value
=
sys
.
exc_info
()[
1
]
self
.
failIf
(
'<'
in
value
)
self
.
failIf
(
'<'
in
value
.
message
)
class
TestItem_w__name__
(
unittest
.
TestCase
):
class
TestItem_w__name__
(
unittest
.
TestCase
):
...
...
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