summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Holtermann <info@markusholtermann.eu>2015-08-19 12:15:59 +1000
committerMarkus Holtermann <info@markusholtermann.eu>2015-08-19 12:18:10 +1000
commitf33607ce0b744794f6ceafa1dddffbcb32e90978 (patch)
tree2b34f28ac6b3ec7d66626ab2d7cbfefeef241be2
parent84335e3d1fcc53862e4d8c24ec58e3b4f608b410 (diff)
Fixed style issues in testing docs
-rw-r--r--docs/topics/testing/tools.txt17
1 files changed, 11 insertions, 6 deletions
diff --git a/docs/topics/testing/tools.txt b/docs/topics/testing/tools.txt
index e5a45ed5d1..28a4921198 100644
--- a/docs/topics/testing/tools.txt
+++ b/docs/topics/testing/tools.txt
@@ -1100,7 +1100,7 @@ For example::
class TestMyViews(TestCase):
urls = 'myapp.test_urls'
- def testIndexPageView(self):
+ def test_index_page_view(self):
# Here you'd test your view using ``Client``.
call_some_test_code()
@@ -1134,11 +1134,11 @@ For example::
class TestMyViews(TestCase):
multi_db = True
- def testIndexPageView(self):
+ def test_index_page_view(self):
call_some_test_code()
This test case will flush *all* the test databases before running
-``testIndexPageView``.
+``test_index_page_view``.
The ``multi_db`` flag also affects into which databases the
attr:`TransactionTestCase.fixtures` are loaded. By default (when
@@ -1517,13 +1517,16 @@ your test suite.
The following examples are valid tests and don't raise any
``AssertionError``::
- self.assertHTMLEqual('<p>Hello <b>world!</p>',
+ self.assertHTMLEqual(
+ '<p>Hello <b>world!</p>',
'''<p>
Hello <b>world! <b/>
- </p>''')
+ </p>'''
+ )
self.assertHTMLEqual(
'<input type="checkbox" checked="checked" id="id_accept_terms" />',
- '<input id="id_accept_terms" type='checkbox' checked>')
+ '<input id="id_accept_terms" type="checkbox" checked>'
+ )
``html1`` and ``html2`` must be valid HTML. An ``AssertionError`` will be
raised if one of them cannot be parsed.
@@ -1740,6 +1743,7 @@ it would under MySQL with MyISAM tables)::
@skipIfDBFeature('supports_transactions')
def test_transaction_behavior(self):
# ... conditional test code
+ pass
.. versionchanged:: 1.8
@@ -1758,6 +1762,7 @@ under MySQL with MyISAM tables)::
@skipUnlessDBFeature('supports_transactions')
def test_transaction_behavior(self):
# ... conditional test code
+ pass
.. versionchanged:: 1.8