Commit ab5653d7 by Alexander Kryklia Committed by polesye

Fix checking exception message.

parent 01882078
...@@ -157,14 +157,9 @@ class RelativeTimeTest(unittest.TestCase): ...@@ -157,14 +157,9 @@ class RelativeTimeTest(unittest.TestCase):
RelativeTimeTest.delta.to_json(100.0) RelativeTimeTest.delta.to_json(100.0)
) )
with self.assertRaises(ValueError) as cm: with self.assertRaisesRegexp(ValueError, "RelativeTime max value is 23:59:59=86400.0 seconds, but 90000.0 seconds is passed"):
RelativeTimeTest.delta.to_json(datetime.timedelta(seconds=90000)) RelativeTimeTest.delta.to_json(datetime.timedelta(seconds=90000))
self.assertEqual(
cm.exception.message,
"RelativeTime max value is 23:59:59=86400.0 seconds, but 90000.0 seconds is passed"
)
with self.assertRaises(TypeError): with self.assertRaises(TypeError):
RelativeTimeTest.delta.to_json("123") RelativeTimeTest.delta.to_json("123")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment