Merge "Stop using deprecated 'message' attribute in Exception"

This commit is contained in:
Jenkins 2017-10-06 19:37:29 +00:00 committed by Gerrit Code Review
commit 732b45ccb3
1 changed files with 2 additions and 2 deletions

View File

@ -28,11 +28,11 @@ class TestException(base.BaseTestCase):
def test_message_is_templated(self): def test_message_is_templated(self):
ex = TestMagnumException(name="NAME") ex = TestMagnumException(name="NAME")
self.assertEqual("templated NAME", ex.message) self.assertEqual("templated NAME", str(ex))
def test_custom_message_is_templated(self): def test_custom_message_is_templated(self):
ex = TestMagnumException(_("custom templated %(name)s"), name="NAME") ex = TestMagnumException(_("custom templated %(name)s"), name="NAME")
self.assertEqual("custom templated NAME", ex.message) self.assertEqual("custom templated NAME", str(ex))
def test_all_exceptions(self): def test_all_exceptions(self):
for name, obj in inspect.getmembers(exception): for name, obj in inspect.getmembers(exception):