Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove a special case for comment tests from runtests.py.

  • Loading branch information...
commit d0561242699ed29527b9ab1dabe8a668e519eba5 1 parent 571b2d1
@jacobian jacobian authored
View
10 tests/comment_tests/tests/comment_utils_moderators_tests.py
@@ -4,6 +4,7 @@
from django.contrib.comments.moderation import (moderator, CommentModerator,
AlreadyModerated)
from django.core import mail
+from django.test.utils import override_settings
from . import CommentTestCase
from ..models import Entry
@@ -67,9 +68,10 @@ def testRegisterExistingModel(self):
self.assertRaises(AlreadyModerated, moderator.register, Entry, EntryModerator1)
def testEmailNotification(self):
- moderator.register(Entry, EntryModerator1)
- self.createSomeComments()
- self.assertEqual(len(mail.outbox), 2)
+ with override_settings(MANAGERS=("test@example.com",)):
+ moderator.register(Entry, EntryModerator1)
+ self.createSomeComments()
+ self.assertEqual(len(mail.outbox), 2)
def testCommentsEnabled(self):
moderator.register(Entry, EntryModerator2)
@@ -94,4 +96,4 @@ def testAutoModerateFieldImmediate(self):
def testAutoCloseFieldImmediate(self):
moderator.register(Entry, EntryModerator6)
c1, c2 = self.createSomeComments()
- self.assertEqual(Comment.objects.all().count(), 0)
+ self.assertEqual(Comment.objects.all().count(), 0)
View
4 tests/runtests.py
@@ -80,10 +80,6 @@ def setup(verbosity, test_labels):
settings.TEMPLATE_DIRS = (os.path.join(RUNTESTS_DIR, TEST_TEMPLATE_DIR),)
settings.LANGUAGE_CODE = 'en'
settings.SITE_ID = 1
- # For testing comment-utils, we require the MANAGERS attribute
- # to be set, so that a test email is sent out which we catch
- # in our tests.
- settings.MANAGERS = ("admin@djangoproject.com",)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
# Load all the ALWAYS_INSTALLED_APPS.
get_apps()
Please sign in to comment.
Something went wrong with that request. Please try again.