#NEWLINE# def test_builtin_datetime_types( self ) : #NEWLINE# #INDENT# ' should convert to millis as-is\n        ' #NEWLINE# a = dt . date ( 2016 , 4 , 28 ) #NEWLINE# b = dt . datetime ( 2016 , 4 , 28 , 2 , 20 , 50 ) #NEWLINE# serialized = self . serialize ( { #NEWLINE# #INDENT# 'a' : [ a ] , #NEWLINE# 'b' : [ serialized ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# deserialized = self . deserialize ( serialized ) #NEWLINE# baseline = { #NEWLINE# #INDENT# 'a' : [ ( time . mktime ( a . timetuple ( ) ) * 1000 ) ] , #NEWLINE# 'b' : [ ( time . mktime ( b . timetuple ( ) ) * 1000 ) ] , #NEWLINE# #UNINDENT# } #NEWLINE# assert ( deserialized == baseline )