Skip to content

Commit

Permalink
[1.7.x] Fixed style issues in testing docs
Browse files Browse the repository at this point in the history
Backport of f33607c from master
  • Loading branch information
MarkusH committed Aug 19, 2015
1 parent 665b9eb commit 6c61cea
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions docs/topics/testing/tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,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()

Expand Down Expand Up @@ -1019,11 +1019,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
Expand Down Expand Up @@ -1406,13 +1406,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.
Expand Down Expand Up @@ -1629,6 +1632,7 @@ it would under MySQL with MyISAM tables)::
@skipIfDBFeature('supports_transactions')
def test_transaction_behavior(self):
# ... conditional test code
pass

.. versionchanged:: 1.7

Expand All @@ -1647,6 +1651,7 @@ under MySQL with MyISAM tables)::
@skipUnlessDBFeature('supports_transactions')
def test_transaction_behavior(self):
# ... conditional test code
pass

.. versionchanged:: 1.7

Expand Down

0 comments on commit 6c61cea

Please sign in to comment.