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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user