summaryrefslogtreecommitdiff
path: root/tests/generic_views/test_base.py
diff options
context:
space:
mode:
authorIan Wilson <ian.owings@gmail.com>2013-09-06 16:25:34 -0500
committerIan Wilson <ian.owings@gmail.com>2013-09-06 16:27:34 -0500
commitb79df0b35861400f573e74d0305d7298c221e7ff (patch)
treefdbbab278bcf65fb3f7c91a96a9074c809e33aef /tests/generic_views/test_base.py
parent630eb0564abd228da439d86ad93acb4089d795e7 (diff)
adds fix for SingleObjectTemplateResponseMixin raising a TemplateDoesNotExist when it should have raised an ImproperlyConfigured. fixes 16502. by @ianawilson, @jambonrose
Diffstat (limited to 'tests/generic_views/test_base.py')
-rw-r--r--tests/generic_views/test_base.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/generic_views/test_base.py b/tests/generic_views/test_base.py
index b1dd7a3040..bd354ee091 100644
--- a/tests/generic_views/test_base.py
+++ b/tests/generic_views/test_base.py
@@ -468,3 +468,15 @@ class UseMultipleObjectMixinTest(unittest.TestCase):
# Overwrite the view's queryset with queryset from kwarg
context = test_view.get_context_data(object_list=queryset)
self.assertEqual(context['object_list'], queryset)
+
+
+class SingleObjectTemplateResponseMixinTest(unittest.TestCase):
+
+ def test_create_view_with_form_only(self):
+ """
+ We want to makes sure that if you use a template mixin, but forget the
+ template, it still tells you it's ImproperlyConfigured instead of
+ TemplateDoesNotExist.
+ """
+ view = views.TemplateResponseWithoutTemplate()
+ self.assertRaises(ImproperlyConfigured, view.get_template_names)