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)

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

  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)
+         self.assertTrue(timestamp <= reply.time)
  
Fix test error under Python 2.6 where assertLessEqual not defined
## Code Before:
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)

## Instruction:
Fix test error under Python 2.6 where assertLessEqual not defined
## Code After:
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)
