diff options
author | Claude Paroz <claude@2xlibre.net> | 2014-12-21 21:19:05 +0100 |
---|---|---|
committer | Claude Paroz <claude@2xlibre.net> | 2014-12-30 18:16:25 +0100 |
commit | 51890ce8898f821d28f2f6fb6071c936e9bd88f0 (patch) | |
tree | 6522c597d411086b0a5c2ec3dd7a1d9bc2feeafd /tests/resolve_url | |
parent | 66f9a74b4514bd259976ce8ee3a4e78288358a5f (diff) | |
download | django-51890ce8898f821d28f2f6fb6071c936e9bd88f0.tar.gz |
Applied ignore_warnings to Django tests
Diffstat (limited to 'tests/resolve_url')
-rw-r--r-- | tests/resolve_url/tests.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/resolve_url/tests.py b/tests/resolve_url/tests.py index 4ea68e460b..ce550ea846 100644 --- a/tests/resolve_url/tests.py +++ b/tests/resolve_url/tests.py @@ -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): """ |