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
a0175724
Kaydet (Commit)
a0175724
authored
May 17, 2015
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added docs for assertRaisesMessage as context manager.
üst
7d97c574
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
tools.txt
docs/topics/testing/tools.txt
+14
-6
No files found.
docs/topics/testing/tools.txt
Dosyayı görüntüle @
a0175724
...
...
@@ -1284,13 +1284,21 @@ message generated by the assertion. This allows you to provide additional
details that may help you to identify the location and cause of an failure in
your test suite.
.. method:: SimpleTestCase.assertRaisesMessage(expected_exception, expected_message, callable_obj=None, *args, **kwargs)
.. method:: SimpleTestCase.assertRaisesMessage(expected_exception, expected_message, callable, *args, **kwargs)
SimpleTestCase.assertRaisesMessage(expected_exception, expected_message)
Asserts that execution of callable ``callable_obj`` raised the
``expected_exception`` exception and that such exception has an
``expected_message`` representation. Any other outcome is reported as a
failure. Similar to unittest's :meth:`~unittest.TestCase.assertRaisesRegex`
with the difference that ``expected_message`` isn't a regular expression.
Asserts that execution of ``callable`` raises ``expected_exception`` and
that the exception has an ``expected_message`` representation. Any other
outcome is reported as a failure. Similar to unittest's
:meth:`~unittest.TestCase.assertRaisesRegex` with the difference that
``expected_message`` isn't a regular expression.
If only the ``expected_exception`` and ``expected_message`` parameters are
given, returns a context manager so that the code being tested can be
written inline rather than as a function::
with self.assertRaisesMessage(ValueError, 'invalid literal for int()'):
int('a')
.. method:: SimpleTestCase.assertFieldOutput(fieldclass, valid, invalid, field_args=None, field_kwargs=None, empty_value='')
...
...
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