From b014dd29fbc569bdab675927ce2e2bef161bda6e Mon Sep 17 00:00:00 2001 From: "Christopher C. Wells" Date: Sun, 25 Oct 2020 09:32:39 -0700 Subject: [PATCH] Fix tests for Python 3.6 support (#170) --- babybuddy/tests/tests_formats.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/babybuddy/tests/tests_formats.py b/babybuddy/tests/tests_formats.py index 23fd58e8..0f402a81 100644 --- a/babybuddy/tests/tests_formats.py +++ b/babybuddy/tests/tests_formats.py @@ -48,13 +48,15 @@ class FormatsTestCase(TestCase): with self.assertRaises(ValidationError): field.to_python('invalid date string!') - dt = datetime.datetime.fromisoformat('2011-11-04 23:05:59') + dt = datetime.datetime(year=2011, month=11, day=4, hour=23, minute=5, + second=59) self.assertEqual( date_format(dt, 'DATETIME_FORMAT'), 'Nov. 4, 2011, 23:05:59') - dt = datetime.datetime.fromisoformat('2011-11-04 02:05:59') + dt = datetime.datetime(year=2011, month=11, day=4, hour=2, minute=5, + second=59) self.assertEqual( date_format(dt, 'SHORT_DATETIME_FORMAT'), '11/04/2011 2:05:59') - t = datetime.time.fromisoformat('16:02:25') + t = datetime.time(hour=16, minute=2, second=25) self.assertEqual(time_format(t), '16:02:25')