From 79bd15ef326e93b926ed69f0858798ceff831ac0 Mon Sep 17 00:00:00 2001
From: Markus Holtermann
Date: Wed, 19 Aug 2015 12:15:59 +1000
Subject: [PATCH] [1.8.x] Fixed style issues in testing docs
Backport of f33607ce0b744794f6ceafa1dddffbcb32e90978 from master
---
docs/topics/testing/tools.txt | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/docs/topics/testing/tools.txt b/docs/topics/testing/tools.txt
index e135bdf64d..bda519d31c 100644
--- a/docs/topics/testing/tools.txt
+++ b/docs/topics/testing/tools.txt
@@ -1072,7 +1072,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()
@@ -1106,11 +1106,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
@@ -1504,13 +1504,16 @@ your test suite.
The following examples are valid tests and don't raise any
``AssertionError``::
- self.assertHTMLEqual('
Hello world!
',
+ self.assertHTMLEqual(
+ '
Hello world!
',
'''
Hello world!
-
''')
+
'''
+ )
self.assertHTMLEqual(
'',
- '')
+ ''
+ )
``html1`` and ``html2`` must be valid HTML. An ``AssertionError`` will be
raised if one of them cannot be parsed.
@@ -1732,6 +1735,7 @@ it would under MySQL with MyISAM tables)::
@skipIfDBFeature('supports_transactions')
def test_transaction_behavior(self):
# ... conditional test code
+ pass
.. versionchanged:: 1.7
@@ -1754,6 +1758,7 @@ under MySQL with MyISAM tables)::
@skipUnlessDBFeature('supports_transactions')
def test_transaction_behavior(self):
# ... conditional test code
+ pass
.. versionchanged:: 1.7