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
42f9d651
Kaydet (Commit)
42f9d651
authored
Agu 04, 2016
tarafından
Chris Jerdonek
Kaydeden (comit)
Tim Graham
Agu 05, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Edited docs of test.utils.setup/teardown_test_environment().
üst
cdf54db6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
15 deletions
+10
-15
utils.py
django/test/utils.py
+6
-9
advanced.txt
docs/topics/testing/advanced.txt
+4
-6
No files found.
django/test/utils.py
Dosyayı görüntüle @
42f9d651
...
...
@@ -95,11 +95,9 @@ def instrumented_test_render(self, context):
def
setup_test_environment
():
"""Perform any global pre-test setup. This involves:
- Installing the instrumented test renderer
- Set the email backend to the locmem email backend.
- Setting the active locale to match the LANGUAGE_CODE setting.
"""
Perform global pre-test setup, such as installing the instrumented template
renderer and setting the email backend to the locmem email backend.
"""
Template
.
_original_render
=
Template
.
_render
Template
.
_render
=
instrumented_test_render
...
...
@@ -120,10 +118,9 @@ def setup_test_environment():
def
teardown_test_environment
():
"""Perform any global post-test teardown. This involves:
- Restoring the original test renderer
- Restoring the email sending functions
"""
Perform any global post-test teardown, such as restoring the original
template renderer and restoring the email sending functions.
"""
Template
.
_render
=
Template
.
_original_render
del
Template
.
_original_render
...
...
docs/topics/testing/advanced.txt
Dosyayı görüntüle @
42f9d651
...
...
@@ -607,15 +607,13 @@ utility methods in the ``django.test.utils`` module.
.. function:: setup_test_environment()
Performs any global pre-test setup, such as the installing the
instrumentation of the template rendering system and setting up
the dummy email outbox.
Performs global pre-test setup, such as installing instrumentation for the
template rendering system and setting up the dummy email outbox.
.. function:: teardown_test_environment()
Performs any global post-test teardown, such as removing the black
magic hooks into the template system and restoring normal email
services.
Performs global post-test teardown, such as removing instrumentation from
the template system and restoring normal email services.
``django.db.connection.creation``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
...
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