Skip to content
Browse files

Fixed imports and nitpicked a bit.

  • Loading branch information...
1 parent 0cf4949 commit 24290a9b69d7b0e1b614fbcac85db1b2ae1e7b01 @jezdez jezdez committed
Showing with 10 additions and 13 deletions.
  1. +8 −11 threaded_messages/tests.py
  2. +2 −2 threaded_messages/utils.py
View
19 threaded_messages/tests.py
@@ -1,10 +1,7 @@
-import datetime
from django.test import TestCase
-from django.contrib.auth.models import User
-from models import Message
-from utils import strip_mail
-from django.utils.html import strip_tags
-
+
+from .utils import strip_mail
+
class UtilsTest(TestCase):
def test_strip_quotes(self):
body = """nyan nyan nyan nyan nyan
@@ -28,15 +25,15 @@ def test_strip_quotes(self):
>
>>
>"""
-
+
body_stripped = """nyan nyan nyan nyan nyan
nyan nyan nyan nyan nyan
nyan nyan nyan nyan nyan
"""
-
+
self.assertEquals(body_stripped.strip(), strip_mail(body).strip())
-
+
def test_single_line_quotes(self):
body = 'asfasf\n\nOn Thu, Dec 15, 2011 at 12:42 PM, Fabrizio S. <messaging@email.gidsy.com>wrote:\n\n> [image: Gidsy] New message\n> Hi Fabrizio, Andrew M. sent you a message\n>\n> *blabla*\n> gasg\n>\n> View and reply<http://email.gidsy.com/wf/click?c=e36x8iH5CyW6UFPc7U%2FiBSpwHwOcqQc55u6Od0IAvnJWLQwR0RdOslgfJYtFkOT0&rp=7%2Bq%2FuBUXPhfnWd079jPZDJw1s3xtQcNITJcDWjO98HB8tJ6%2BYeP23y9SaOFiXvnpboQhDnEJRnrEZfRP9WnHQiL7q9Y0Plign2S9mx7i8%2Bk%3D&u=icfx5E9JS66UPX7QM9UvGw%2Fh0>\n>\n> Sincerely,\n> the *Gidsy team*<http://email.gidsy.com/wf/click?c=nun%2FbaehJTxhIK1KvYwhU5Tg16XMq0b2DKd6IxvO%2F%2Bw%3D&rp=7%2Bq%2FuBUXPhfnWd079jPZDJw1s3xtQcNITJcDWjO98HB8tJ6%2BYeP23y9SaOFiXvnpboQhDnEJRnrEZfRP9WnHQiL7q9Y0Plign2S9mx7i8%2Bk%3D&u=icfx5E9JS66UPX7QM9UvGw%2Fh1>\n>\n> This email was intended for fabrizio@gidsy.com. If you do not want to\n> receive emails like this from staging.gidsy.com<http://email.gidsy.com/wf/click?c=e36x8iH5CyW6UFPc7U%2FiBY72qxV4NIiQfC%2BfF%2BpSEec%3D&rp=7%2Bq%2FuBUXPhfnWd079jPZDJw1s3xtQcNITJcDWjO98HB8tJ6%2BYeP23y9SaOFiXvnpboQhDnEJRnrEZfRP9WnHQiL7q9Y0Plign2S9mx7i8%2Bk%3D&u=icfx5E9JS66UPX7QM9UvGw%2Fh2>anymore, then please change your Email\n> notification settings <http://notice-email-setting/>.\n>\n> Copyright \ufffd 2011 Gidsy.com, All rights reserved.\n>\n'
@@ -49,8 +46,8 @@ def test_strip_signature(self):
body_stripped = "signature test"
self.assertEquals(body_stripped.strip(), strip_mail(body).strip())
-
-
+
+
def test_no_signature(self):
pass
#TODO: add support for stripped html
View
4 threaded_messages/utils.py
@@ -13,7 +13,7 @@
from django.template.loader import render_to_string, get_template
import settings as tm_settings
-from models import Message, Participant
+from .models import Message, Participant
if "notification" in settings.INSTALLED_APPS:
@@ -43,7 +43,7 @@ def open_message_thread(recipients, subject, template,
else:
body = message
- from forms import ComposeForm #temporary here to remove circular dependence
+ from forms import ComposeForm # temporary here to remove circular dependence
compose_form = ComposeForm(data={
"recipient": recipients,
"subject": subject,

0 comments on commit 24290a9

Please sign in to comment.
Something went wrong with that request. Please try again.