summaryrefslogtreecommitdiff
path: root/src/zope/traversing/browser/tests.py
diff options
context:
space:
mode:
authorJason Madden <jamadden@gmail.com>2018-10-16 09:36:08 -0500
committerJason Madden <jamadden@gmail.com>2018-10-16 09:36:08 -0500
commit41a17e50eb506016836de01743befa0867f22814 (patch)
tree750263ca1a9d9cb0c471012e6556b24cb9a74295 /src/zope/traversing/browser/tests.py
parentcfaa1fa9f3bed5758b3d8c5a01959bd0ab6295ff (diff)
downloadzope-traversing-41a17e50eb506016836de01743befa0867f22814.tar.gz
Fix deprecation warnings.issue10
Fixes #10
Diffstat (limited to 'src/zope/traversing/browser/tests.py')
-rw-r--r--src/zope/traversing/browser/tests.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/zope/traversing/browser/tests.py b/src/zope/traversing/browser/tests.py
index 861cb9c..51c58dd 100644
--- a/src/zope/traversing/browser/tests.py
+++ b/src/zope/traversing/browser/tests.py
@@ -73,6 +73,9 @@ class FooLocation(object):
class TestAbsoluteURL(PlacelessSetup, unittest.TestCase):
+ assertRaisesRegex = getattr(unittest.TestCase, 'assertRaisesRegex',
+ getattr(unittest.TestCase, 'assertRaisesRegexp'))
+
def setUp(self):
PlacelessSetup.setUp(self)
from zope.traversing.browser import AbsoluteURL, SiteAbsoluteURL
@@ -306,8 +309,8 @@ class TestAbsoluteURL(PlacelessSetup, unittest.TestCase):
def test_breadcrumbs_no_parent(self):
view = AbsoluteURL(self, None)
- with self.assertRaisesRegexp(TypeError,
- "There isn't enough context"):
+ with self.assertRaisesRegex(TypeError,
+ "There isn't enough context"):
view.breadcrumbs()
def test_nameless_context(self):
@@ -343,8 +346,8 @@ class TestAbsoluteURL(PlacelessSetup, unittest.TestCase):
# First the view
view = AbsoluteURL(context, request)
- with self.assertRaisesRegexp(TypeError,
- "There isn't enough context"):
+ with self.assertRaisesRegex(TypeError,
+ "There isn't enough context"):
str(view)
self.assertTrue(DummyAbsoluteURL.called)
@@ -352,8 +355,8 @@ class TestAbsoluteURL(PlacelessSetup, unittest.TestCase):
# Now the breadcrumbs
view = AbsoluteURL(context, request)
- with self.assertRaisesRegexp(TypeError,
- "There isn't enough context"):
+ with self.assertRaisesRegex(TypeError,
+ "There isn't enough context"):
view.breadcrumbs()
self.assertTrue(DummyAbsoluteURL.called)