mirror of
https://github.com/django/django.git
synced 2024-12-28 03:55:50 +00:00
cc5477df89
the start of a suite of tests for the debug views. Thanks, Alex Gaynor. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10271 bcc190cf-cafb-0310-a4f2-bffc1f526a37
22 lines
672 B
Python
22 lines
672 B
Python
from django.conf import settings
|
|
from django.core.files.uploadedfile import SimpleUploadedFile
|
|
from django.test import TestCase
|
|
|
|
class DebugViewTests(TestCase):
|
|
def setUp(self):
|
|
settings.DEBUG = True
|
|
|
|
def tearDown(self):
|
|
settings.DEBUG = False
|
|
|
|
def test_files(self):
|
|
response = self.client.get('/views/raises/')
|
|
self.assertEquals(response.status_code, 500)
|
|
|
|
data = {
|
|
'file_data.txt': SimpleUploadedFile('file_data.txt', 'haha'),
|
|
}
|
|
response = self.client.post('/views/raises/', data)
|
|
self.failUnless('file_data.txt' in response.content)
|
|
self.failIf('haha' in response.content)
|