def test_find(self):
        message_thread = MessageThread.find(email="*****@*****.**", 
                thread_id=17565)
        self.assertEqual(17565, message_thread.thread_id)

        messages = message_thread.messages
        self.assertEqual('*****@*****.**', messages[0].author.email)
        self.assertEqual(False, messages[0].author.admin)
        self.assertEqual(None, messages[0].author.name)

        self.assertEqual(None, messages[1].author.email)
        self.assertEqual(None, messages[1].author.user_id)
        self.assertEqual(True, messages[1].author.admin)
        self.assertEqual('Joe', messages[1].author.name)
        self.assertEqual('https://example.com/avatar.jpg', 
                messages[1].author.avatar_path_50)

        self.assertTrue('Hi' in messages[1].html)
        self.assertTrue(isinstance(messages[1].created_at, datetime))
        self.assertEqual(1331767859, 
                time.mktime(messages[1].created_at.timetuple()))
Exemple #2
0
    def test_find(self):
        message_thread = MessageThread.find(email="*****@*****.**", 
                thread_id=17565)
        self.assertEqual(17565, message_thread.thread_id)

        messages = message_thread.messages
        self.assertEqual('*****@*****.**', messages[0].author.email)
        self.assertEqual(False, messages[0].author.admin)
        self.assertEqual(None, messages[0].author.name)

        self.assertEqual(None, messages[1].author.email)
        self.assertEqual(None, messages[1].author.user_id)
        self.assertEqual(True, messages[1].author.admin)
        self.assertEqual('Joe', messages[1].author.name)
        self.assertEqual('https://example.com/avatar.jpg', 
                messages[1].author.avatar_path_50)

        self.assertTrue('Hi' in messages[1].html)
        self.assertTrue(isinstance(messages[1].created_at, datetime))
        self.assertEqual(1331767859, 
                time.mktime(messages[1].created_at.timetuple()))
def test_find_no_thread_id():
    MessageThread.find(email='*****@*****.**')
 def test_find_no_thread_id(self):
     message_thread = MessageThread.find(email="*****@*****.**")
Exemple #5
0
 def test_find_no_thread_id(self):
     message_thread = MessageThread.find(email="*****@*****.**")
def test_find_no_thread_id():
    MessageThread.find(email="*****@*****.**")