#NEWLINE# def test_advanced_identify( self ) : #NEWLINE# #INDENT# client = self . client #NEWLINE# ( success , msg ) = client . identify ( 'userId' , { #NEWLINE# #INDENT# 'trait' : 'value' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'ip' : '192.168.0.1' , #NEWLINE# #UNINDENT# } , datetime ( 2014 , 9 , 3 ) , 'anonymousId' , { #NEWLINE# #INDENT# 'Amplitude' : True , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertTrue ( success ) #NEWLINE# self . assertEqual ( msg [ 'timestamp' ] , '2014-09-03T00:00:00+00:00' ) #NEWLINE# self . assertEqual ( msg [ 'integrations' ] , { #NEWLINE# #INDENT# 'Amplitude' : True , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( msg [ 'context' ] [ 'ip' ] , '192.168.0.1' ) #NEWLINE# self . assertEqual ( msg [ 'traits' ] , { #NEWLINE# #INDENT# 'trait' : 'value' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( msg [ 'anonymousId' ] , 'anonymousId' ) #NEWLINE# self . assertEqual ( msg [ 'context' ] [ 'library' ] , { #NEWLINE# #INDENT# 'name' : 'analytics-python' , #NEWLINE# 'version' : VERSION , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertTrue ( isinstance ( msg [ 'timestamp' ] , str ) ) #NEWLINE# self . assertTrue ( isinstance ( msg [ 'messageId' ] , str ) ) #NEWLINE# self . assertEqual ( msg [ 'userId' ] , 'userId' ) #NEWLINE# self . assertEqual ( msg [ 'type' ] , 'identify' )