From a61b34b048d84b2a8af78a42a4e635371252bd3f Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Mon, 7 Jun 2010 17:52:53 +0000 Subject: [soc2010/query-refactor] Merged up to trunk r13328. git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/query-refactor@13329 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/topics/testing.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'docs/topics/testing.txt') diff --git a/docs/topics/testing.txt b/docs/topics/testing.txt index bd727ee136..9b23d546df 100644 --- a/docs/topics/testing.txt +++ b/docs/topics/testing.txt @@ -1248,6 +1248,19 @@ cause of an failure in your test suite. ``target_status_code`` will be the url and status code for the final point of the redirect chain. +.. method:: TestCase.assertQuerysetEqual(response, qs, values, transform=repr) + + Asserts that a queryset ``qs`` returns a particular list of values ``values``. + + The comparison of the contents of ``qs`` and ``values`` is performed using + the function ``transform``; by default, this means that the ``repr()`` of + each value is compared. Any other callable can be used if ``repr()`` doesn't + provide a unique or helpful comparison. + + The comparison is also ordering dependent. If ``qs`` doesn't provide an + implicit ordering, you will need to apply a ``order_by()`` clause to your + queryset to ensure that the test will pass reliably. + .. _topics-testing-email: E-mail services -- cgit v1.3