From 571b2d139baa81ae9a0afea88c5b570a2d16d313 Mon Sep 17 00:00:00 2001
From: Jacob Kaplan-Moss <jacob@jacobian.org>
Date: Sat, 9 Mar 2013 08:49:37 -0600
Subject: [PATCH 1/2] Deprecated django.contrib.comments.

---
 django/contrib/comments/__init__.py      |  3 +++
 docs/index.txt                           |  1 -
 docs/internals/deprecation.txt           |  2 ++
 docs/ref/contrib/comments/custom.txt     | 12 ++++++++++++
 docs/ref/contrib/comments/example.txt    | 12 ++++++++++++
 docs/ref/contrib/comments/forms.txt      | 14 +++++++++++++-
 docs/ref/contrib/comments/index.txt      | 12 ++++++++++++
 docs/ref/contrib/comments/models.txt     | 12 ++++++++++++
 docs/ref/contrib/comments/moderation.txt | 12 ++++++++++++
 docs/ref/contrib/comments/signals.txt    | 12 ++++++++++++
 docs/releases/1.6.txt                    | 13 +++++++++++++
 11 files changed, 103 insertions(+), 2 deletions(-)

diff --git a/django/contrib/comments/__init__.py b/django/contrib/comments/__init__.py
index 1798c1adb5..007b77ad7b 100644
--- a/django/contrib/comments/__init__.py
+++ b/django/contrib/comments/__init__.py
@@ -1,3 +1,4 @@
+import warnings
 from django.conf import settings
 from django.core import urlresolvers
 from django.core.exceptions import ImproperlyConfigured
@@ -5,6 +6,8 @@ from django.contrib.comments.models import Comment
 from django.contrib.comments.forms import CommentForm
 from django.utils.importlib import import_module
 
+warnings.warn("django.contrib.comments is deprecated and will be removed before Django 1.8.", PendingDeprecationWarning)
+
 DEFAULT_COMMENTS_APP = 'django.contrib.comments'
 
 def get_comment_app():
diff --git a/docs/index.txt b/docs/index.txt
index 73b378de4d..197856ea4b 100644
--- a/docs/index.txt
+++ b/docs/index.txt
@@ -254,7 +254,6 @@ applications:
 * :doc:`Logging <topics/logging>`
 * :doc:`Sending emails <topics/email>`
 * :doc:`Syndication feeds (RSS/Atom) <ref/contrib/syndication>`
-* :doc:`Comments <ref/contrib/comments/index>`, :doc:`comment moderation <ref/contrib/comments/moderation>` and :doc:`custom comments <ref/contrib/comments/custom>`
 * :doc:`Pagination <topics/pagination>`
 * :doc:`Messages framework <ref/contrib/messages>`
 * :doc:`Serialization <topics/serialization>`
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt
index 19675801e4..b9948affcb 100644
--- a/docs/internals/deprecation.txt
+++ b/docs/internals/deprecation.txt
@@ -365,6 +365,8 @@ these changes.
   - ``django.db.transaction.commit_unless_managed()``
   - ``django.db.transaction.rollback_unless_managed()``
 
+* ``django.contrib.comments`` will be removed.
+
 2.0
 ---
 
diff --git a/docs/ref/contrib/comments/custom.txt b/docs/ref/contrib/comments/custom.txt
index b4ab65bc2d..fd70a6a224 100644
--- a/docs/ref/contrib/comments/custom.txt
+++ b/docs/ref/contrib/comments/custom.txt
@@ -4,6 +4,18 @@ Customizing the comments framework
 
 .. currentmodule:: django.contrib.comments
 
+.. warning::
+
+    Django's comment framework has been deprecated and is no longer supported.
+    Most users will be better served with a custom solution, or a hosted
+    product like Disqus__.
+
+    The code formerly known as ``django.contrib.comments`` is `still available
+    in an external repository`__.
+
+    __ https://disqus.com/
+    __ https://github.com/django/django-contrib-comments
+
 If the built-in comment framework doesn't quite fit your needs, you can extend
 the comment app's behavior to add custom data and logic. The comments framework
 lets you extend the built-in comment model, the built-in comment form, and the
diff --git a/docs/ref/contrib/comments/example.txt b/docs/ref/contrib/comments/example.txt
index e99c10f732..abf79c5f14 100644
--- a/docs/ref/contrib/comments/example.txt
+++ b/docs/ref/contrib/comments/example.txt
@@ -4,6 +4,18 @@
 Example of using the built-in comments app
 ===========================================
 
+.. warning::
+
+    Django's comment framework has been deprecated and is no longer supported.
+    Most users will be better served with a custom solution, or a hosted
+    product like Disqus__.
+
+    The code formerly known as ``django.contrib.comments`` is `still available
+    in an external repository`__.
+
+    __ https://disqus.com/
+    __ https://github.com/django/django-contrib-comments
+
 Follow the first three steps of the quick start guide in the
 :doc:`documentation </ref/contrib/comments/index>`.
 
diff --git a/docs/ref/contrib/comments/forms.txt b/docs/ref/contrib/comments/forms.txt
index c21a27bb9e..f2624ca870 100644
--- a/docs/ref/contrib/comments/forms.txt
+++ b/docs/ref/contrib/comments/forms.txt
@@ -5,6 +5,18 @@ Comment form classes
 .. module:: django.contrib.comments.forms
    :synopsis: Forms for dealing with the built-in comment model.
 
+.. warning::
+
+    Django's comment framework has been deprecated and is no longer supported.
+    Most users will be better served with a custom solution, or a hosted
+    product like Disqus__.
+
+    The code formerly known as ``django.contrib.comments`` is `still available
+    in an external repository`__.
+
+    __ https://disqus.com/
+    __ https://github.com/django/django-contrib-comments
+
 The ``django.contrib.comments.forms`` module contains a handful of forms
 you'll use when writing custom views dealing with comments, or when writing
 :doc:`custom comment apps </ref/contrib/comments/custom>`.
@@ -43,4 +55,4 @@ forms that you can subclass to reuse pieces of the form handling logic:
    Handles the details of the comment itself.
 
    This class contains the ``name``, ``email``, ``url``, and the ``comment``
-   field itself, along with the associated validation logic.
\ No newline at end of file
+   field itself, along with the associated validation logic.
diff --git a/docs/ref/contrib/comments/index.txt b/docs/ref/contrib/comments/index.txt
index d4e967b4b2..6db69d8168 100644
--- a/docs/ref/contrib/comments/index.txt
+++ b/docs/ref/contrib/comments/index.txt
@@ -7,6 +7,18 @@ Django's comments framework
 
 .. highlightlang:: html+django
 
+.. warning::
+
+    Django's comment framework has been deprecated and is no longer supported.
+    Most users will be better served with a custom solution, or a hosted
+    product like Disqus__.
+
+    The code formerly known as ``django.contrib.comments`` is `still available
+    in an external repository`__.
+
+    __ https://disqus.com/
+    __ https://github.com/django/django-contrib-comments
+
 Django includes a simple, yet customizable comments framework. The built-in
 comments framework can be used to attach comments to any model, so you can use
 it for comments on blog entries, photos, book chapters, or anything else.
diff --git a/docs/ref/contrib/comments/models.txt b/docs/ref/contrib/comments/models.txt
index 78e7b92145..cae9c11971 100644
--- a/docs/ref/contrib/comments/models.txt
+++ b/docs/ref/contrib/comments/models.txt
@@ -5,6 +5,18 @@ The built-in comment models
 .. module:: django.contrib.comments.models
    :synopsis: The built-in comment models
 
+.. warning::
+
+    Django's comment framework has been deprecated and is no longer supported.
+    Most users will be better served with a custom solution, or a hosted
+    product like Disqus__.
+
+    The code formerly known as ``django.contrib.comments`` is `still available
+    in an external repository`__.
+
+    __ https://disqus.com/
+    __ https://github.com/django/django-contrib-comments
+
 .. class:: Comment
 
     Django's built-in comment model. Has the following fields:
diff --git a/docs/ref/contrib/comments/moderation.txt b/docs/ref/contrib/comments/moderation.txt
index a7138dda53..796e257200 100644
--- a/docs/ref/contrib/comments/moderation.txt
+++ b/docs/ref/contrib/comments/moderation.txt
@@ -5,6 +5,18 @@ Generic comment moderation
 .. module:: django.contrib.comments.moderation
    :synopsis: Support for automatic comment moderation.
 
+.. warning::
+
+    Django's comment framework has been deprecated and is no longer supported.
+    Most users will be better served with a custom solution, or a hosted
+    product like Disqus__.
+
+    The code formerly known as ``django.contrib.comments`` is `still available
+    in an external repository`__.
+
+    __ https://disqus.com/
+    __ https://github.com/django/django-contrib-comments
+
 Django's bundled comments application is extremely useful on its own,
 but the amount of comment spam circulating on the Web today
 essentially makes it necessary to have some sort of automatic
diff --git a/docs/ref/contrib/comments/signals.txt b/docs/ref/contrib/comments/signals.txt
index ea901b6a95..f9df8980d7 100644
--- a/docs/ref/contrib/comments/signals.txt
+++ b/docs/ref/contrib/comments/signals.txt
@@ -5,6 +5,18 @@ Signals sent by the comments app
 .. module:: django.contrib.comments.signals
    :synopsis: Signals sent by the comment module.
 
+.. warning::
+
+    Django's comment framework has been deprecated and is no longer supported.
+    Most users will be better served with a custom solution, or a hosted
+    product like Disqus__.
+
+    The code formerly known as ``django.contrib.comments`` is `still available
+    in an external repository`__.
+
+    __ https://disqus.com/
+    __ https://github.com/django/django-contrib-comments
+
 The comment app sends a series of :doc:`signals </topics/signals>` to allow for
 comment moderation and similar activities. See :doc:`the introduction to signals
 </topics/signals>` for information about how to register for and receive these
diff --git a/docs/releases/1.6.txt b/docs/releases/1.6.txt
index a1fe69229c..eec55c6632 100644
--- a/docs/releases/1.6.txt
+++ b/docs/releases/1.6.txt
@@ -271,6 +271,19 @@ current APIs are deprecated:
 The reasons for this change and the upgrade path are described in the
 :ref:`transactions documentation <transactions-upgrading-from-1.5>`.
 
+``django.contrib.comments``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Django's comment framework has been deprecated and is no longer supported. It
+will be available in Django 1.6 and 1.7, and removed in Django 1.8. Most users
+will be better served with a custom solution, or a hosted product like Disqus__.
+
+The code formerly known as ``django.contrib.comments`` is `still available
+in an external repository`__.
+
+__ https://disqus.com/
+__ https://github.com/django/django-contrib-comments
+
 Changes to :ttag:`cycle` and :ttag:`firstof`
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

From d0561242699ed29527b9ab1dabe8a668e519eba5 Mon Sep 17 00:00:00 2001
From: Jacob Kaplan-Moss <jacob@jacobian.org>
Date: Mon, 11 Mar 2013 10:04:58 -0500
Subject: [PATCH 2/2] Remove a special case for comment tests from runtests.py.

---
 .../tests/comment_utils_moderators_tests.py            | 10 ++++++----
 tests/runtests.py                                      |  4 ----
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/tests/comment_tests/tests/comment_utils_moderators_tests.py b/tests/comment_tests/tests/comment_utils_moderators_tests.py
index eab87ef53b..6c7a882e25 100644
--- a/tests/comment_tests/tests/comment_utils_moderators_tests.py
+++ b/tests/comment_tests/tests/comment_utils_moderators_tests.py
@@ -4,6 +4,7 @@ from django.contrib.comments.models import Comment
 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 @@ class CommentUtilsModeratorTests(CommentTestCase):
         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 @@ class CommentUtilsModeratorTests(CommentTestCase):
     def testAutoCloseFieldImmediate(self):
         moderator.register(Entry, EntryModerator6)
         c1, c2 = self.createSomeComments()
-        self.assertEqual(Comment.objects.all().count(), 0)
\ No newline at end of file
+        self.assertEqual(Comment.objects.all().count(), 0)
diff --git a/tests/runtests.py b/tests/runtests.py
index f2cd933776..f0cba38b80 100755
--- a/tests/runtests.py
+++ b/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",)
 
     # Load all the ALWAYS_INSTALLED_APPS.
     get_apps()