adds fix for SingleObjectTemplateResponseMixin raising a TemplateDoesNotExist when it should have raised an ImproperlyConfigured. fixes 16502. by @ianawilson, @jambonrose

This commit is contained in:
Ian Wilson 2013-09-06 16:25:34 -05:00
parent 630eb0564a
commit b79df0b358
3 changed files with 47 additions and 21 deletions

View file

@ -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)