summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLuke Plant <L.Plant.98@cantab.net>2011-09-30 11:46:23 +0000
committerLuke Plant <L.Plant.98@cantab.net>2011-09-30 11:46:23 +0000
commit10d90cba83d5dfbe52eb5501279c3db71b42dd41 (patch)
tree4778f76411706c9de023ce89f2451d43dcdd8bdf /tests
parent5009e45dfe366ebf520eecb49d72d5a11cee1623 (diff)
Fixed #16935 - misleading message if AttributeError escapes during SimpleTemplateResponse.render
Thanks to isagalaev for the report. As discussed on django-devs, this reverts some of the changes in [16568] i.e. the addition of `SimpleTemplateResponse.__getattr__`, because this makes it much harder to debug the common case of an AttributeError somewhere during the rendering of a SimpleTemplateResponse. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16917 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/templates/response.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/regressiontests/templates/response.py b/tests/regressiontests/templates/response.py
index 0e067405ad..f7bcb60f1b 100644
--- a/tests/regressiontests/templates/response.py
+++ b/tests/regressiontests/templates/response.py
@@ -9,8 +9,7 @@ from django.conf import settings
import django.template.context
from django.template import Template, Context
from django.template.response import (TemplateResponse, SimpleTemplateResponse,
- ContentNotRenderedError,
- DiscardedAttributeError)
+ ContentNotRenderedError)
def test_processor(request):
return {'processors': 'yes'}
@@ -198,7 +197,7 @@ class SimpleTemplateResponseTest(BaseTemplateResponseTest):
# ...and requesting any of those attributes raises an exception
for attr in template_attrs:
- with self.assertRaises(DiscardedAttributeError) as cm:
+ with self.assertRaises(AttributeError):
getattr(unpickled_response, attr)
def test_repickling(self):
@@ -282,7 +281,7 @@ class TemplateResponseTest(BaseTemplateResponseTest):
# ...and requesting any of those attributes raises an exception
for attr in template_attrs:
- with self.assertRaises(DiscardedAttributeError) as cm:
+ with self.assertRaises(AttributeError):
getattr(unpickled_response, attr)
def test_repickling(self):