Skip to content
Browse files

Merge pull request #8 from Osmose/fix-missing-set-import

Fix bug 794541: Import missing SET variable.
  • Loading branch information...
2 parents b0ca8ec + 209774d commit e4b9f60cbce01b3571da21f988bbd27354226891 @Osmose Osmose committed Sep 26, 2012
Showing with 22 additions and 1 deletion.
  1. +21 −0 apps/news/tests.py
  2. +1 −1 apps/news/views.py
View
21 apps/news/tests.py
@@ -0,0 +1,21 @@
+from django import test
+from django.http import QueryDict
+
+from mock import patch
+
+from news.models import Subscriber
+from news.tasks import SET
+
+
+class UserTest(test.TestCase):
+ @patch('news.views.update_user')
+ def test_user_set(self, update_user):
+ """If the user view is sent a POST request, it should attempt to update
+ the user's info.
+ """
+ subscriber = Subscriber(email='test@example.com', token='asdf')
+ subscriber.save()
+
+ self.client.post('/news/user/asdf/', {'fake': 'data'})
+ update_user.assert_called_with(QueryDict('fake=data'),
+ 'test@example.com', SET, True)
View
2 apps/news/views.py
@@ -8,7 +8,7 @@
import re
from tasks import (add_sms_user, update_user, confirm_user,
- update_student_reps, SUBSCRIBE, UNSUBSCRIBE)
+ update_student_reps, SET, SUBSCRIBE, UNSUBSCRIBE)
from newsletters import *
from models import Subscriber
from backends.exacttarget import (ExactTargetDataExt, NewsletterException,

0 comments on commit e4b9f60

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