From 6118d6d1c982e428cf398ac998eb9f0baba15bad Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Sat, 29 Jun 2013 11:52:29 +0200 Subject: [PATCH] More import removals Following the series of commits removing deprecated features in Django 1.7, here are some more unneeded imports removed and other minor cleanups. --- django/contrib/auth/forms.py | 2 -- django/contrib/auth/models.py | 6 ------ django/contrib/auth/tests/test_models.py | 2 +- django/contrib/sitemaps/views.py | 1 - django/shortcuts/__init__.py | 2 -- django/test/testcases.py | 1 - docs/ref/utils.txt | 2 +- tests/.coveragerc | 2 +- tests/test_utils/tests.py | 1 - 9 files changed, 3 insertions(+), 16 deletions(-) diff --git a/django/contrib/auth/forms.py b/django/contrib/auth/forms.py index beff18c0f2..2d7a7c14d4 100644 --- a/django/contrib/auth/forms.py +++ b/django/contrib/auth/forms.py @@ -1,7 +1,5 @@ from __future__ import unicode_literals -import warnings - from django import forms from django.forms.util import flatatt from django.template import loader diff --git a/django/contrib/auth/models.py b/django/contrib/auth/models.py index 5e3c6451f9..cf3d37e5c3 100644 --- a/django/contrib/auth/models.py +++ b/django/contrib/auth/models.py @@ -1,8 +1,6 @@ from __future__ import unicode_literals import re -import warnings -from django.core.exceptions import ImproperlyConfigured from django.core.mail import send_mail from django.core import validators from django.db import models @@ -31,10 +29,6 @@ def update_last_login(sender, user, **kwargs): user_logged_in.connect(update_last_login) -class SiteProfileNotAvailable(Exception): - pass - - class PermissionManager(models.Manager): def get_by_natural_key(self, codename, app_label, model): return self.get( diff --git a/django/contrib/auth/tests/test_models.py b/django/contrib/auth/tests/test_models.py index cd3a13b76d..fa20775a8d 100644 --- a/django/contrib/auth/tests/test_models.py +++ b/django/contrib/auth/tests/test_models.py @@ -1,5 +1,5 @@ from django.contrib.auth import get_user_model -from django.contrib.auth.models import (Group, User, UserManager) +from django.contrib.auth.models import Group, User, UserManager from django.contrib.auth.tests.utils import skipIfCustomUser from django.db.models.signals import post_save from django.test import TestCase diff --git a/django/contrib/sitemaps/views.py b/django/contrib/sitemaps/views.py index 63551a925b..7a94fb355d 100644 --- a/django/contrib/sitemaps/views.py +++ b/django/contrib/sitemaps/views.py @@ -1,4 +1,3 @@ -import warnings from functools import wraps from django.contrib.sites.models import get_current_site diff --git a/django/shortcuts/__init__.py b/django/shortcuts/__init__.py index 828b6d2d37..b096efdb44 100644 --- a/django/shortcuts/__init__.py +++ b/django/shortcuts/__init__.py @@ -3,8 +3,6 @@ This module collects helper functions and classes that "span" multiple levels of MVC. In other words, these functions/classes introduce controlled coupling for convenience's sake. """ -import warnings - from django.template import loader, RequestContext from django.http import HttpResponse, Http404 from django.http import HttpResponseRedirect, HttpResponsePermanentRedirect diff --git a/django/test/testcases.py b/django/test/testcases.py index 4300df2856..53b15158ca 100644 --- a/django/test/testcases.py +++ b/django/test/testcases.py @@ -15,7 +15,6 @@ except ImportError: # Python 2 import select import socket import threading -import warnings from django.conf import settings from django.contrib.staticfiles.handlers import StaticFilesHandler diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt index c29c210be7..d7be7a4735 100644 --- a/docs/ref/utils.txt +++ b/docs/ref/utils.txt @@ -188,7 +188,7 @@ The functions defined in this module share the following properties: ========================= .. module:: django.utils.encoding - :synopsis: A series of helper function to manage character encoding. + :synopsis: A series of helper functions to manage character encoding. .. function:: python_2_unicode_compatible diff --git a/tests/.coveragerc b/tests/.coveragerc index cd7fee3c89..1b4c087f14 100644 --- a/tests/.coveragerc +++ b/tests/.coveragerc @@ -1,5 +1,5 @@ [run] -omit = */django/contrib/*/tests*,*/django/utils/unittest*,*/django/utils/simplejson*,*/django/utils/importlib.py,*/django/test/_doctest.py,*/django/core/servers/fastcgi.py,*/django/utils/autoreload.py,*/django/utils/dictconfig.py +omit = */django/contrib/*/tests*,*/django/utils/unittest*,*/django/utils/importlib.py,*/django/test/_doctest.py,*/django/core/servers/fastcgi.py,*/django/utils/autoreload.py,*/django/utils/dictconfig.py [html] directory = coverage_html diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py index b51ba7bf3b..8c6c15e357 100644 --- a/tests/test_utils/tests.py +++ b/tests/test_utils/tests.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals -import warnings from django.db import connection from django.forms import EmailField, IntegerField