mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #5416 -- Added TestCase.assertNumQueries, which tests that a given function executes the correct number of queries.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14183 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
r"""
|
||||
import sys
|
||||
|
||||
if sys.version_info >= (2, 5):
|
||||
from python_25 import AssertNumQueriesTests
|
||||
|
||||
|
||||
__test__ = {"API_TEST": r"""
|
||||
# Some checks of the doctest output normalizer.
|
||||
# Standard doctests do fairly
|
||||
# Standard doctests do fairly
|
||||
>>> from django.utils import simplejson
|
||||
>>> from django.utils.xmlutils import SimplerXMLGenerator
|
||||
>>> from StringIO import StringIO
|
||||
@@ -55,7 +61,7 @@ r"""
|
||||
>>> produce_json()
|
||||
'["foo", {"whiz": 42, "bar": ["baz", null, 1.0, 2]}]'
|
||||
|
||||
# XML output is normalized for attribute order, so it doesn't matter
|
||||
# XML output is normalized for attribute order, so it doesn't matter
|
||||
# which order XML element attributes are listed in output
|
||||
>>> produce_xml()
|
||||
'<?xml version="1.0" encoding="UTF-8"?>\n<foo aaa="1.0" bbb="2.0"><bar ccc="3.0">Hello</bar><whiz>Goodbye</whiz></foo>'
|
||||
@@ -69,4 +75,4 @@ r"""
|
||||
>>> produce_xml_fragment()
|
||||
'<foo bbb="2.0" aaa="1.0">Hello</foo><bar ddd="4.0" ccc="3.0"></bar>'
|
||||
|
||||
"""
|
||||
"""}
|
||||
|
||||
Reference in New Issue
Block a user