summaryrefslogtreecommitdiffstats
path: root/askbot/tests
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-11-02 18:54:17 -0300
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-11-02 18:54:17 -0300
commitfc26b08ad98dd427ab882f8ec332dfdfea2ca9b2 (patch)
treed3ed7937f52e3ffaa9fa99de4f155d7c50d71890 /askbot/tests
parent6142e8399aaba645f64dce2db911cffbf9e95f86 (diff)
downloadaskbot-fc26b08ad98dd427ab882f8ec332dfdfea2ca9b2.tar.gz
askbot-fc26b08ad98dd427ab882f8ec332dfdfea2ca9b2.tar.bz2
askbot-fc26b08ad98dd427ab882f8ec332dfdfea2ca9b2.zip
added some test cases for the quote separator stripping
Diffstat (limited to 'askbot/tests')
-rw-r--r--askbot/tests/email_parsing_tests.py24
1 files changed, 16 insertions, 8 deletions
diff --git a/askbot/tests/email_parsing_tests.py b/askbot/tests/email_parsing_tests.py
index 7e09652f..c1cea215 100644
--- a/askbot/tests/email_parsing_tests.py
+++ b/askbot/tests/email_parsing_tests.py
@@ -24,14 +24,22 @@ class EmailParseTests(utils.AskbotTestCase):
print "CLEANED BODY"
self.assertEquals(cleaned_body, self.expected_output)
-"""collection of quote separators separated with an empty line
-u'\n\nthis is my reply!\n\nOn Wed, Oct 31, 2012 at 1:45 AM, <kp@kp-dev.askbot.com> wrote:\n\n> **\n> '
-
-u'\n\nthis is my another reply!\n\nOn Wed, Oct 31, 2012 at 1:45 AM, <kp@kp-dev.askbot.com> wrote:\n>\n> '
-
-u'\n\nSending this from my yahoo mail account.\n\n\n\n________________________________\n From: "kp@kp-dev.askbot.com" <kp@kp-dev.askbot.com>\nTo: fadeev@rocketmail.com \nSent: Wednesday, October 31, 2012 2:41 AM\nSubject: "This is my test question"\n \n\n \n \n \n'
-
-u'On Monday 01 October 2012 21:22:44 you wrote: \n\nSecond try, no HTML kmail does weird things.'
+ def test_gmail_rich_text_response_stripped(self):
+ text = u'\n\nthis is my reply!\n\nOn Wed, Oct 31, 2012 at 1:45 AM, <kp@kp-dev.askbot.com> wrote:\n\n> **\n> '
+ self.assertEqual(mail.extract_body(text), 'this is my reply!')
+
+ def test_gmail_plain_text_response_stripped(text):
+ text = u'\n\nthis is my another reply!\n\nOn Wed, Oct 31, 2012 at 1:45 AM, <kp@kp-dev.askbot.com> wrote:\n>\n> '
+ self.assertEqual(mail.extract_body(text), 'this is my another reply!')
+
+ def test_yahoo_mail_response_stripped(self):
+ text = u'\n\nthis is my reply!\n\n\n\n________________________________\n From: "kp@kp-dev.askbot.com" <kp@kp-dev.askbot.com>\nTo: fadeev@rocketmail.com \nSent: Wednesday, October 31, 2012 2:41 AM\nSubject: "This is my test question"\n \n\n \n \n \n'
+ self.assertEqual(mail.extract_body(text), 'this is my reply!')
+
+ def test_kmail_plain_text_response_stripped(text):
+ text = u'On Monday 01 October 2012 21:22:44 you wrote: \n\nSecond try, no HTML kmail does weird things.'
+ self.assertEqual(mail.extract_body(text), 'this is my reply!')
+
u'outlook.com (new hotmail) with RTF on \n\nSubject: "Posting a question by email." \nFrom: kp@kp-dev.askbot.com \nTo: aj_fitoria@hotmail.com \nDate: Thu, 1 Nov 2012 16:30:27 +0000'