mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-07 22:04:48 +03:00
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:
parent
e61a4f19cf
commit
8966d8e458
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue
Block a user