mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Applied ignore_warnings to Django tests
This commit is contained in:
parent
66f9a74b45
commit
51890ce889
57 changed files with 513 additions and 711 deletions
|
@ -1,10 +1,9 @@
|
|||
from __future__ import unicode_literals
|
||||
import warnings
|
||||
|
||||
from django.core.urlresolvers import NoReverseMatch
|
||||
from django.contrib.auth.views import logout
|
||||
from django.shortcuts import resolve_url
|
||||
from django.test import TestCase, override_settings
|
||||
from django.test import TestCase, ignore_warnings, override_settings
|
||||
from django.utils.deprecation import RemovedInDjango20Warning
|
||||
|
||||
from .models import UnimportantThing
|
||||
|
@ -57,15 +56,14 @@ class ResolveUrlTests(TestCase):
|
|||
resolved_url = resolve_url(logout)
|
||||
self.assertEqual('/accounts/logout/', resolved_url)
|
||||
|
||||
@ignore_warnings(category=RemovedInDjango20Warning)
|
||||
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.
|
||||
"""
|
||||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings("ignore", category=RemovedInDjango20Warning)
|
||||
resolved_url = resolve_url('django.contrib.auth.views.logout')
|
||||
self.assertEqual('/accounts/logout/', resolved_url)
|
||||
resolved_url = resolve_url('django.contrib.auth.views.logout')
|
||||
self.assertEqual('/accounts/logout/', resolved_url)
|
||||
|
||||
def test_domain(self):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue