From cd79f337233be3f2dfa22316314c9d4834093e31 Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Mon, 27 May 2013 14:41:39 -0600 Subject: [PATCH] Fixed #20503 - Moved doctest utilities in with the rest of the deprecated test code. The ``DocTestRunner`` and ``OutputChecker`` were formerly in ``django.test.testcases``, now they are in ``django.test.simple``. This avoids triggering the ``django.test._doctest`` deprecation message with any import from ``django.test``. Since these utility classes are undocumented internal API, they can be moved without a separate deprecation process. Also removed the deprecation warnings specific to these classes, as they are now covered by the module-level warning in ``django.test.simple``. Thanks Anssi for the report. Refs #17365. --- django/test/simple.py | 70 +++++++++++++++++++++++++++++- django/test/testcases.py | 79 +--------------------------------- docs/internals/deprecation.txt | 6 +-- docs/releases/1.6.txt | 18 +++----- 4 files changed, 78 insertions(+), 95 deletions(-) diff --git a/django/test/simple.py b/django/test/simple.py index 5117c6452f..f28b8a2830 100644 --- a/django/test/simple.py +++ b/django/test/simple.py @@ -3,14 +3,15 @@ This module is pending deprecation as of Django 1.6 and will be removed in version 1.8. """ - +import json +import re import unittest as real_unittest import warnings from django.db.models import get_app, get_apps from django.test import _doctest as doctest from django.test import runner -from django.test.testcases import OutputChecker, DocTestRunner +from django.test.utils import compare_xml, strip_quotes from django.utils import unittest from django.utils.importlib import import_module from django.utils.module_loading import module_has_submodule @@ -25,6 +26,71 @@ warnings.warn( # The module name for tests outside models.py TEST_MODULE = 'tests' + +normalize_long_ints = lambda s: re.sub(r'(?