From 8966d8e4586ca240ef8a89a0734c6049a43172f8 Mon Sep 17 00:00:00 2001 From: cabbagenom Date: Sun, 27 Mar 2016 12:17:51 +0100 Subject: [PATCH] DateTimeField tests reflect Python 2's strptime limitations. Given that Python 2's datetime.datetime.strptime function does not accept '+HHMM' strings with the format directive '%z', the tests for accepting such strings have been ommitted for python 2. --- tests/test_fields.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_fields.py b/tests/test_fields.py index cce0181fa..b31f59c7f 100644 --- a/tests/test_fields.py +++ b/tests/test_fields.py @@ -981,9 +981,10 @@ class TestDateTimeField(FieldValues): '2001-01-01T01:01': '2001-01-01T01:01:00', '2001-01-01T01:01:01': '2001-01-01T01:01:01', '2001-01-01T01:01:01.01': '2001-01-01T01:01:01.010000', - '2001-01-01T01:01+0100': '2001-01-01T01:01:00+01:00', - '2001-01-01T01:01:01+0100': '2001-01-01T01:01:01+01:00', - '2001-01-01T01:01:01.01+0100': '2001-01-01T01:01:01.010000+01:00', + # Caveat of Python 2's datetime module does not allow '+HHMM' ISO-8601 strings to be parsed in Python 2's strptime + '2001-01-01T01:01+0100' if six.PY3 else None: '2001-01-01T01:01:00+01:00' if six.PY3 else None, + '2001-01-01T01:01:01+0100' if six.PY3 else None: '2001-01-01T01:01:01+01:00' if six.PY3 else None, + '2001-01-01T01:01:01.01+0100' if six.PY3 else None: '2001-01-01T01:01:01.010000+01:00' if six.PY3 else None, '2001-01-01T01:01UTC': '2001-01-01T01:01:00', '2001-01-01T01:01:01UTC': '2001-01-01T01:01:01', '2001-01-01T01:01:01.01UTC': '2001-01-01T01:01:01.010000',