Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
f33607ce
Kaydet (Commit)
f33607ce
authored
Agu 19, 2015
tarafından
Markus Holtermann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed style issues in testing docs
üst
84335e3d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
tools.txt
docs/topics/testing/tools.txt
+11
-6
No files found.
docs/topics/testing/tools.txt
Dosyayı görüntüle @
f33607ce
...
@@ -1100,7 +1100,7 @@ For example::
...
@@ -1100,7 +1100,7 @@ For example::
class TestMyViews(TestCase):
class TestMyViews(TestCase):
urls = 'myapp.test_urls'
urls = 'myapp.test_urls'
def test
IndexPageV
iew(self):
def test
_index_page_v
iew(self):
# Here you'd test your view using ``Client``.
# Here you'd test your view using ``Client``.
call_some_test_code()
call_some_test_code()
...
@@ -1134,11 +1134,11 @@ For example::
...
@@ -1134,11 +1134,11 @@ For example::
class TestMyViews(TestCase):
class TestMyViews(TestCase):
multi_db = True
multi_db = True
def test
IndexPageV
iew(self):
def test
_index_page_v
iew(self):
call_some_test_code()
call_some_test_code()
This test case will flush *all* the test databases before running
This test case will flush *all* the test databases before running
``test
IndexPageV
iew``.
``test
_index_page_v
iew``.
The ``multi_db`` flag also affects into which databases the
The ``multi_db`` flag also affects into which databases the
attr:`TransactionTestCase.fixtures` are loaded. By default (when
attr:`TransactionTestCase.fixtures` are loaded. By default (when
...
@@ -1517,13 +1517,16 @@ your test suite.
...
@@ -1517,13 +1517,16 @@ your test suite.
The following examples are valid tests and don't raise any
The following examples are valid tests and don't raise any
``AssertionError``::
``AssertionError``::
self.assertHTMLEqual('<p>Hello <b>world!</p>',
self.assertHTMLEqual(
'<p>Hello <b>world!</p>',
'''<p>
'''<p>
Hello <b>world! <b/>
Hello <b>world! <b/>
</p>''')
</p>'''
)
self.assertHTMLEqual(
self.assertHTMLEqual(
'<input type="checkbox" checked="checked" id="id_accept_terms" />',
'<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
``html1`` and ``html2`` must be valid HTML. An ``AssertionError`` will be
raised if one of them cannot be parsed.
raised if one of them cannot be parsed.
...
@@ -1740,6 +1743,7 @@ it would under MySQL with MyISAM tables)::
...
@@ -1740,6 +1743,7 @@ it would under MySQL with MyISAM tables)::
@skipIfDBFeature('supports_transactions')
@skipIfDBFeature('supports_transactions')
def test_transaction_behavior(self):
def test_transaction_behavior(self):
# ... conditional test code
# ... conditional test code
pass
.. versionchanged:: 1.8
.. versionchanged:: 1.8
...
@@ -1758,6 +1762,7 @@ under MySQL with MyISAM tables)::
...
@@ -1758,6 +1762,7 @@ under MySQL with MyISAM tables)::
@skipUnlessDBFeature('supports_transactions')
@skipUnlessDBFeature('supports_transactions')
def test_transaction_behavior(self):
def test_transaction_behavior(self):
# ... conditional test code
# ... conditional test code
pass
.. versionchanged:: 1.8
.. versionchanged:: 1.8
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment