#NEWLINE# def test_datetime_dict_keys_defaults( self ) : #NEWLINE# #INDENT# 'Test that we handle datetime objects as keys.' #NEWLINE# datetime_dict = { #NEWLINE# #INDENT# datetime . datetime ( 2008 , 12 , 31 ) : True , #NEWLINE# #UNINDENT# } #NEWLINE# pickled = jsonpickle . encode ( datetime_dict ) #NEWLINE# expect = { #NEWLINE# #INDENT# 'datetime.datetime(2008, 12, 31, 0, 0)' : True , #NEWLINE# #UNINDENT# } #NEWLINE# actual = jsonpickle . decode ( pickled ) #NEWLINE# self . assertEqual ( expect , actual )