Insert the resolved_object context variable in the test views.

This commit is contained in:
Roberto Rosario
2016-03-30 01:42:17 -04:00
parent c6890c487a
commit 1e7e17bdce

View File

@@ -50,7 +50,9 @@ class GenericViewTestCase(TestCase):
def test_view(request):
template = Template('{{ object }}')
context = Context({'object': test_object})
context = Context(
{'object': test_object, 'resolved_object': test_object}
)
return HttpResponse(template.render(context=context))
urlpatterns.insert(0, url(TEST_VIEW_URL, test_view, name=TEST_VIEW_NAME))