diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-05-28 06:22:56 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-05-28 06:22:56 -0400 |
commit | 1815e7a2f5b01652a19caeddd2ab0cfb63fe9139 (patch) | |
tree | 1a4903ab0d384913da65404a4b05017ef185aa29 /askbot/tests/email_alert_tests.py | |
parent | 12382d0eecbd8228e3dc47c2a419371b22507927 (diff) | |
download | askbot-1815e7a2f5b01652a19caeddd2ab0cfb63fe9139.tar.gz askbot-1815e7a2f5b01652a19caeddd2ab0cfb63fe9139.tar.bz2 askbot-1815e7a2f5b01652a19caeddd2ab0cfb63fe9139.zip |
hopefully fixed bugs with the approval notification messages
Diffstat (limited to 'askbot/tests/email_alert_tests.py')
-rw-r--r-- | askbot/tests/email_alert_tests.py | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/askbot/tests/email_alert_tests.py b/askbot/tests/email_alert_tests.py index 5f20496d..6d0cc105 100644 --- a/askbot/tests/email_alert_tests.py +++ b/askbot/tests/email_alert_tests.py @@ -954,26 +954,34 @@ class PostApprovalTests(utils.AskbotTestCase): """test notifications sent to authors when their posts are approved or published""" def setUp(self): + self.reply_by_email = askbot_settings.REPLY_BY_EMAIL + askbot_settings.update('REPLY_BY_EMAIL', True) + self.enable_content_moderation = \ + askbot_settings.ENABLE_CONTENT_MODERATION + askbot_settings.update('ENABLE_CONTENT_MODERATION', True) assert( django_settings.EMAIL_BACKEND == 'django.core.mail.backends.locmem.EmailBackend' ) + def tearDown(self): + askbot_settings.update( + 'REPLY_BY_EMAIL', self.reply_by_email + ) + askbot_settings.update( + 'ENABLE_CONTENT_MODERATION', + self.enable_content_moderation + ) + def test_emailed_question_answerable_approval_notification(self): - setting_backup = askbot_settings.REPLY_BY_EMAIL - askbot_settings.update('REPLY_BY_EMAIL', True) - self.u1 = self.create_user('user1', status = 'a') + self.u1 = self.create_user('user1', status = 'a')#regular user question = self.post_question(user = self.u1, by_email = True) outbox = django.core.mail.outbox + #here we should get just the notification of the post + #being placed on the moderation queue self.assertEquals(len(outbox), 1) self.assertEquals(outbox[0].recipients(), [self.u1.email]) - askbot_settings.update('REPLY_BY_EMAIL', setting_backup) def test_moderated_question_answerable_approval_notification(self): - setting_backup1 = askbot_settings.REPLY_BY_EMAIL - askbot_settings.update('REPLY_BY_EMAIL', True) - setting_backup2 = askbot_settings.ENABLE_CONTENT_MODERATION - askbot_settings.update('ENABLE_CONTENT_MODERATION', True) - u1 = self.create_user('user1', status = 'a') question = self.post_question(user = u1, by_email = True) @@ -989,7 +997,3 @@ class PostApprovalTests(utils.AskbotTestCase): #moderation notification self.assertEquals(outbox[0].recipients(), [u1.email,]) self.assertEquals(outbox[1].recipients(), [u1.email,])#approval - - askbot_settings.update('REPLY_BY_EMAIL', setting_backup1) - askbot_settings.update('ENABLE_CONTENT_MODERATION', setting_backup2) - |