mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #21977 -- Deprecated SimpleTestCase.urls
This commit is contained in:
parent
d2f4553d70
commit
cd914e31c9
73 changed files with 337 additions and 295 deletions
|
@ -29,10 +29,10 @@ from django.test import override_settings
|
|||
from .views import get_view
|
||||
|
||||
|
||||
@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',))
|
||||
@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',),
|
||||
ROOT_URLCONF='test_client.urls',)
|
||||
class ClientTest(TestCase):
|
||||
fixtures = ['testdata.json']
|
||||
urls = 'test_client.urls'
|
||||
|
||||
def test_get_view(self):
|
||||
"GET a view"
|
||||
|
@ -499,10 +499,10 @@ class ClientTest(TestCase):
|
|||
|
||||
|
||||
@override_settings(
|
||||
MIDDLEWARE_CLASSES=('django.middleware.csrf.CsrfViewMiddleware',)
|
||||
MIDDLEWARE_CLASSES=('django.middleware.csrf.CsrfViewMiddleware',),
|
||||
ROOT_URLCONF='test_client.urls',
|
||||
)
|
||||
class CSRFEnabledClientTests(TestCase):
|
||||
urls = 'test_client.urls'
|
||||
|
||||
def test_csrf_enabled_client(self):
|
||||
"A client can be instantiated with CSRF checks enabled"
|
||||
|
@ -529,8 +529,8 @@ class CustomTestClientTest(TestCase):
|
|||
self.assertEqual(hasattr(self.client, "i_am_customized"), True)
|
||||
|
||||
|
||||
@override_settings(ROOT_URLCONF='test_client.urls')
|
||||
class RequestFactoryTest(TestCase):
|
||||
urls = 'test_client.urls'
|
||||
|
||||
def test_request_factory(self):
|
||||
factory = RequestFactory()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue