#NEWLINE# def test_base_message( self ) : #NEWLINE# #INDENT# from wechatpy.messages import TextMessage #NEWLINE# timestamp = int ( time . time ( ) ) #NEWLINE# msg = TextMessage ( { #NEWLINE# #INDENT# 'MsgId' : 123456 , #NEWLINE# 'MsgType' : 'text' , #NEWLINE# 'FromUserName' : 'user1' , #NEWLINE# 'ToUserName' : 'user2' , #NEWLINE# 'CreateTime' : timestamp , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( 123456 , msg . id ) #NEWLINE# self . assertEqual ( 'user1' , msg . source ) #NEWLINE# self . assertEqual ( 'user2' , msg . target ) #NEWLINE# self . assertTrue ( isinstance ( msg . create_time , datetime ) )