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.
This commit is contained in:
cabbagenom 2016-03-27 12:17:51 +01:00
parent e61a4f19cf
commit 8966d8e458

View File

@ -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',