aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAymeric Augustin2013-10-14 23:20:24 +0200
committerAymeric Augustin2013-10-14 23:20:24 +0200
commitf4699b2333aa42024fce0f75c33cec7412747faf (patch)
tree71b70ee5cd8173c0b8a8235714c30e5dbd86a0da /tests
parent7e4ecfd04cfe61b51e1fd6fdf0ce1c800a3ebb3b (diff)
downloaddjango-debug-toolbar-f4699b2333aa42024fce0f75c33cec7412747faf.tar.bz2
Fix a failing test on Django 1.5.
It was failing since I added a default context with a few constants.
Diffstat (limited to 'tests')
-rw-r--r--tests/tests.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/tests.py b/tests/tests.py
index f76f1ab..fcb6c1e 100644
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -1,6 +1,7 @@
from __future__ import with_statement
import thread
+import django
from django.conf import settings
from django.contrib.auth.models import User
from django.db import connection
@@ -263,7 +264,8 @@ class TemplatePanelTestCase(BaseTestCase):
t.render(c)
# ensure the query was NOT logged
self.assertEquals(len(sql_panel._queries), 0)
- ctx = template_panel.templates[0]['context'][0]
+ base_ctx_idx = 1 if django.VERSION[:2] >= (1, 5) else 0
+ ctx = template_panel.templates[0]['context'][base_ctx_idx]
self.assertIn('<<queryset of auth.User>>', ctx)
self.assertIn('<<triggers database query>>', ctx)