﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21462	Making assertNumQueries print the list of queries executed on failure	Dominic Rodger	nobody	"Currently, when assertNumQueries fails, the output is perhaps less helpful than it might be:

{{{
Traceback (most recent call last):
  File ""/home/dom/.virtualenvs/kanisa/src/kanisa/kanisa/tests/views/public.py"", line 31, in test_kanisa_root_view
    [banner1.pk, banner2.pk, banner3.pk, banner5.pk, ])
  File ""/home/dom/.virtualenvs/kanisa/src/kanisa/.tox/py27-1.5.X/local/lib/python2.7/site-packages/django/test/testcases.py"", line 195, in __exit__
    executed, self.num
AssertionError: 5 queries executed, 99 expected
}}}

When an assertNumQueries check fails, the first thing I (and I'd guess everyone else too) want to know is what queries ran, so it'd be awesome if an assertNumQueries failure printed the list of queries. Charlie Denton has a blog post describing how he does this (http://meshy.co.uk/posts/debugging-assertnumqueries-tests/), but I'd like to see this included in Django itself - since it seems generally helpful.

This was discussed on django-developers (https://groups.google.com/forum/#!topic/django-developers/8aUL9d9yyzg)."	New feature	closed	Testing framework	1.6	Normal	fixed			Ready for checkin	0	0	0	0	0	0
