Kaydet (Commit) 55b0b766 authored tarafından Hasan Ramezani's avatar Hasan Ramezani Kaydeden (comit) Tim Graham

Completed test coverage of views.defaults.bad_request().

üst 717ee63e
......@@ -72,6 +72,13 @@ class DefaultsTests(TestCase):
response = self.client.get('/server_error/')
self.assertEqual(response.status_code, 500)
def test_bad_request(self):
rf = RequestFactory()
request = rf.get('/')
response = bad_request(request, Exception())
self.assertEqual(response.status_code, 400)
self.assertEqual(response.content, b'<h1>Bad Request (400)</h1>')
@override_settings(TEMPLATES=[{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'OPTIONS': {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment