1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #22384 -- Removed the ability to reverse URLs by dotted path per deprecation timeline.

This commit is contained in:
Tim Graham
2015-08-17 13:45:07 -04:00
parent d79122f40b
commit 785cc71d5b
15 changed files with 93 additions and 298 deletions

View File

@@ -3,9 +3,8 @@ from __future__ import unicode_literals
from django.contrib.auth.views import logout
from django.core.urlresolvers import NoReverseMatch, reverse_lazy
from django.shortcuts import resolve_url
from django.test import SimpleTestCase, ignore_warnings, override_settings
from django.test import SimpleTestCase, override_settings
from django.utils import six
from django.utils.deprecation import RemovedInDjango110Warning
from .models import UnimportantThing
@@ -51,8 +50,8 @@ class ResolveUrlTests(SimpleTestCase):
def test_view_function(self):
"""
Tests that passing a view name to ``resolve_url`` will result in the
URL path mapping to that view name.
Tests that passing a view function to ``resolve_url`` will result in
the URL path mapping to that view name.
"""
resolved_url = resolve_url(logout)
self.assertEqual('/accounts/logout/', resolved_url)
@@ -66,13 +65,12 @@ class ResolveUrlTests(SimpleTestCase):
self.assertIsInstance(resolved_url, six.text_type)
self.assertEqual('/accounts/logout/', resolved_url)
@ignore_warnings(category=RemovedInDjango110Warning)
def test_valid_view_name(self):
"""
Tests that passing a view function to ``resolve_url`` will result in
the URL path mapping to that view.
Tests that passing a view name to ``resolve_url`` will result in the
URL path mapping to that view.
"""
resolved_url = resolve_url('django.contrib.auth.views.logout')
resolved_url = resolve_url('logout')
self.assertEqual('/accounts/logout/', resolved_url)
def test_domain(self):