mirror of https://github.com/django/django.git
Refs #15903 -- Added a per-TestCase urlconf to reduce coupling between test apps.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16107 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
c85b765288
commit
04654e554f
|
@ -12,6 +12,8 @@ from regressiontests.views import BrokenException, except_args
|
||||||
|
|
||||||
|
|
||||||
class DebugViewTests(TestCase):
|
class DebugViewTests(TestCase):
|
||||||
|
urls = "regressiontests.views.urls"
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.old_debug = settings.DEBUG
|
self.old_debug = settings.DEBUG
|
||||||
settings.DEBUG = True
|
settings.DEBUG = True
|
||||||
|
@ -23,13 +25,13 @@ class DebugViewTests(TestCase):
|
||||||
settings.TEMPLATE_DEBUG = self.old_template_debug
|
settings.TEMPLATE_DEBUG = self.old_template_debug
|
||||||
|
|
||||||
def test_files(self):
|
def test_files(self):
|
||||||
response = self.client.get('/views/raises/')
|
response = self.client.get('/raises/')
|
||||||
self.assertEqual(response.status_code, 500)
|
self.assertEqual(response.status_code, 500)
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
'file_data.txt': SimpleUploadedFile('file_data.txt', 'haha'),
|
'file_data.txt': SimpleUploadedFile('file_data.txt', 'haha'),
|
||||||
}
|
}
|
||||||
response = self.client.post('/views/raises/', data)
|
response = self.client.post('/raises/', data)
|
||||||
self.assertTrue('file_data.txt' in response.content)
|
self.assertTrue('file_data.txt' in response.content)
|
||||||
self.assertFalse('haha' in response.content)
|
self.assertFalse('haha' in response.content)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue