def test_convert(): message = werobot.testing.make_text_message('test') reply = werobot.reply.TextReply(message, content='中文', time=1359803261) assert reply.render() reply = werobot.reply.TextReply(message, content=to_unicode('中文'), time=1359803261) assert reply.render()
def test_convert(): message = werobot.test.make_text_message('test') reply = werobot.reply.TextReply(message, content='中文', time=1359803261) assert reply.render() reply = werobot.reply.TextReply(message, content=to_unicode('中文'), time=1359803261) assert reply.render()
def test_wechatreply_render(): message = werobot.testing.make_text_message('test') reply = werobot.reply.WeChatReply(message, content='hello', time=1359803261) try: reply.render() except NotImplementedError: pass else: raise
def test_text_render(): message = werobot.test.make_text_message('test') reply = werobot.reply.TextReply(message, content='hello', time=1359803261) reply_message = """ <xml> <ToUserName><![CDATA[test]]></ToUserName> <FromUserName><![CDATA[test]]></FromUserName> <CreateTime>1359803261</CreateTime> <MsgType><![CDATA[text]]></MsgType> <Content><![CDATA[hello]]></Content> <FuncFlag>0</FuncFlag> </xml> """.strip().replace(" ", "").replace("\n", "") result = reply.render().strip().replace(" ", "").replace("\n", "") assert result == to_unicode(reply_message)
def test_convert(): message = werobot.test.make_text_message("test") reply = werobot.reply.TextReply(message, content="中文", time=1359803261) assert reply.render() reply = werobot.reply.TextReply(message, content=to_unicode("中文"), time=1359803261) assert reply.render()