mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
adds fix for SingleObjectTemplateResponseMixin raising a TemplateDoesNotExist when it should have raised an ImproperlyConfigured. fixes 16502. by @ianawilson, @jambonrose
This commit is contained in:
parent
630eb0564a
commit
b79df0b358
3 changed files with 47 additions and 21 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue