# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import time
import unittest


class ReplyTestCase(unittest.TestCase):

    def test_base_reply(self):
        from wechatpy.replies import TextReply

        timestamp = int(time.time())
        reply = TextReply(source='user1', target='user2')

        self.assertEqual('user1', reply.source)
        self.assertEqual('user2', reply.target)
        self.assertLessEqual(timestamp, reply.time)

# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import time
import unittest


class ReplyTestCase(unittest.TestCase):

    def test_base_reply(self):
        from wechatpy.replies import TextReply

        timestamp = int(time.time())
        reply = TextReply(source='user1', target='user2')

        self.assertEqual('user1', reply.source)
        self.assertEqual('user2', reply.target)
        self.assertTrue(timestamp <= reply.time)

Fix test error under Python 2.6 where assertLessEqual not defined
Fix test error under Python 2.6 where assertLessEqual not defined
