Skip to content


Subversion checkout URL

You can clone with
Download ZIP


TemplatePanelTestCase fails under Django 1.5 #360

lucasicf opened this Issue · 3 comments

3 participants


This test is the only test which is failing on Django 1.5. I had to change the requirements on for running the tests:


This is the error message:

Traceback (most recent call last):
 File "/home/lucas/Projects/django-debug-toolbar/tests/", line 268, in test_queryset_hook
    self.assertIn('<<queryset of auth.User>>', ctx)
AssertionError: '<<queryset of auth.User>>' not found in "{'False': False, 'None': None, 'True': True}"

The point is: I suppose Django 1.5 has added this the support for True, False and None in the templates and this is passed in the context. Here is the patch in Django:

printing template_panel.templates returns this with Django 1.4:

    'signal': <django.dispatch.dispatcher.Signal object at [someaddress]>,
    'context': [
        "{'deep_queryset': '<<triggers database query>>',\n 'queryset': u'<<queryset of auth.User>>'}"
    'template': <django.template.base.Template object at [someaddress]>

and this with Django 1.5:

    'signal': <django.dispatch.dispatcher.Signal object at [someaddress]>,
    'context': [
        "{'False': False, 'None': None, 'True': True}",
        "{'deep_queryset': '<<triggers database query>>',\n 'queryset': '<<queryset of auth.User>>'}"
    'template': <django.template.base.Template object at [someaddress]>

Since it checks for template_panel.templates[0]['context'][0], which returns the dictionary-string for the "False, None, True" thing, I believe the test can be changed to look for that strings in the whole context, not just the first position of the context.


Here is the proposed patch:





Thanks for your contribution. In fact I fixed this issue yesterday with f4699b2.

Sorry I didn't notice your pull request. I'm new here and slowly going though the backlog of issues and pull requests.

@aaugustin aaugustin closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.