Skip to content
Snippets Groups Projects
Commit ab5653d7 authored by Alexander Kryklia's avatar Alexander Kryklia Committed by polesye
Browse files

Fix checking exception message.

parent 01882078
No related merge requests found
......@@ -157,14 +157,9 @@ class RelativeTimeTest(unittest.TestCase):
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))
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):
RelativeTimeTest.delta.to_json("123")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment