mirror of
https://github.com/django/django.git
synced 2025-11-02 04:48:33 +00:00
Fixed #16744 -- Class based view should have the view object in the context
Updated the most recent patch from @claudep to apply again and updated the documentation location.
This commit is contained in:
parent
547b181046
commit
58683e9c82
8 changed files with 35 additions and 2 deletions
|
|
@ -2,6 +2,7 @@ from __future__ import absolute_import
|
|||
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.test import TestCase
|
||||
from django.views.generic.base import View
|
||||
|
||||
from .models import Artist, Author, Page
|
||||
|
||||
|
|
@ -14,6 +15,7 @@ class DetailViewTest(TestCase):
|
|||
res = self.client.get('/detail/obj/')
|
||||
self.assertEqual(res.status_code, 200)
|
||||
self.assertEqual(res.context['object'], {'foo': 'bar'})
|
||||
self.assertTrue(isinstance(res.context['view'], View))
|
||||
self.assertTemplateUsed(res, 'generic_views/detail.html')
|
||||
|
||||
def test_detail_by_pk(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue