Fixing the TemplatePanelTestCase.test_queryset_hook under Django 1.5.

Fixes #360 issue.