diff --git a/tests/urlpatterns_reverse/tests.py b/tests/urlpatterns_reverse/tests.py
index b2a6d83..48a48a9 100644
a
|
b
|
from django.contrib.auth.models import User
|
9 | 9 | from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist |
10 | 10 | from django.core.urlresolvers import (reverse, reverse_lazy, resolve, get_callable, |
11 | 11 | get_resolver, NoReverseMatch, Resolver404, ResolverMatch, RegexURLResolver, |
12 | | RegexURLPattern) |
| 12 | RegexURLPattern, _callable_cache) |
13 | 13 | from django.http import HttpRequest, HttpResponseRedirect, HttpResponsePermanentRedirect |
14 | 14 | from django.shortcuts import redirect |
15 | 15 | from django.test import TestCase |
… |
… |
class ErroneousViewTests(TestCase):
|
662 | 662 | |
663 | 663 | class ViewLoadingTests(TestCase): |
664 | 664 | def test_view_loading(self): |
| 665 | _callable_cache.clear() |
| 666 | |
665 | 667 | # A missing view (identified by an AttributeError) should raise |
666 | 668 | # ViewDoesNotExist, ... |
667 | 669 | six.assertRaisesRegex(self, ViewDoesNotExist, ".*View does not exist in.*", |
… |
… |
class ViewLoadingTests(TestCase):
|
671 | 673 | # swallow it. |
672 | 674 | self.assertRaises(AttributeError, get_callable, |
673 | 675 | 'urlpatterns_reverse.views_broken.i_am_broken') |
| 676 | |
| 677 | def test_can_fail_memorizing(self): |
| 678 | _callable_cache.clear() |
| 679 | |
| 680 | # Swallowing an exception is fine... |
| 681 | get_callable('urlpatterns_reverse.views.i_should_not_exist', True) |
| 682 | |
| 683 | ## ... but it should not affect non-swallowing calls. |
| 684 | six.assertRaisesRegex(self, ViewDoesNotExist, |
| 685 | ".*View does not exist in.*", |
| 686 | get_callable, |
| 687 | 'urlpatterns_reverse.views.i_should_not_exist') |