Skip to content
Browse files

Modernized views.DebugViewTests

  • Loading branch information...
1 parent 93e6733 commit b1fb6f48201e00c6ea0eae37a839525657cf71e2 @claudep claudep committed
Showing with 6 additions and 15 deletions.
  1. +6 −15 tests/regressiontests/views/tests/
21 tests/regressiontests/views/tests/
@@ -1,36 +1,27 @@
-from __future__ import absolute_import
+from __future__ import absolute_import, unicode_literals
import inspect
import os
import sys
from django.conf import settings
+from django.core import mail
from django.core.files.uploadedfile import SimpleUploadedFile
-from django.test import TestCase, RequestFactory
-from django.test.utils import (setup_test_template_loader,
- restore_template_loaders)
from django.core.urlresolvers import reverse
+from django.test import TestCase, RequestFactory
+from django.test.utils import (override_settings, setup_test_template_loader,
+ restore_template_loaders)
from django.views.debug import ExceptionReporter
-from django.core import mail
from .. import BrokenException, except_args
from ..views import (sensitive_view, non_sensitive_view, paranoid_view,
custom_exception_reporter_filter_view, sensitive_method_view)
+@override_settings(DEBUG=True, TEMPLATE_DEBUG=True)
class DebugViewTests(TestCase):
urls = "regressiontests.views.urls"
- def setUp(self):
- self.old_debug = settings.DEBUG
- settings.DEBUG = True
- self.old_template_debug = settings.TEMPLATE_DEBUG
- settings.TEMPLATE_DEBUG = True
- def tearDown(self):
- settings.DEBUG = self.old_debug
- settings.TEMPLATE_DEBUG = self.old_template_debug
def test_files(self):
response = self.client.get('/raises/')
self.assertEqual(response.status_code, 500)

0 comments on commit b1fb6f4

Please sign in to comment.
Something went wrong with that request. Please try again.