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
bc02a963
Kaydet (Commit)
bc02a963
authored
May 06, 2013
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #20177 - Corrected docs for django.test.utils.setup_test_environment.
Thanks vlad.london.uk@ for the report.
üst
e8868089
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
tutorial05.txt
docs/intro/tutorial05.txt
+7
-0
advanced.txt
docs/topics/testing/advanced.txt
+8
-4
No files found.
docs/intro/tutorial05.txt
Dosyayı görüntüle @
bc02a963
...
...
@@ -326,6 +326,13 @@ in the shell::
>>> from django.test.utils import setup_test_environment
>>> setup_test_environment()
:meth:`~django.test.utils.setup_test_environment` installs a template renderer
which will allow us to examine some additional attributes on responses such as
``response.context`` that otherwise wouldn't be available. Note that this
method *does not* setup a test database, so the following will be run against
the existing database and the output may differ slightly depending on what
polls you already created.
Next we need to import the test client class (later in ``tests.py`` we will use
the :class:`django.test.TestCase` class, which comes with its own client, so
this won't be required)::
...
...
docs/topics/testing/advanced.txt
Dosyayı görüntüle @
bc02a963
...
...
@@ -163,10 +163,12 @@ environment first. Django provides a convenience method to do this::
>>> from django.test.utils import setup_test_environment
>>> setup_test_environment()
This convenience method sets up the test database, and puts other
Django features into modes that allow for repeatable testing.
:func:`~django.test.utils.setup_test_environment` puts several Django features
into modes that allow for repeatable testing, but does not create the test
databases; :func:`django.test.simple.DjangoTestSuiteRunner.setup_databases`
takes care of that.
The call to :
meth
:`~django.test.utils.setup_test_environment` is made
The call to :
func
:`~django.test.utils.setup_test_environment` is made
automatically as part of the setup of ``./manage.py test``. You only
need to manually invoke this method if you're not using running your
tests via Django's test runner.
...
...
@@ -282,7 +284,9 @@ Methods
.. method:: DjangoTestSuiteRunner.setup_test_environment(**kwargs)
Sets up the test environment ready for testing.
Sets up the test environment by calling
:func:`~django.test.utils.setup_test_environment` and setting
:setting:`DEBUG` to ``False``.
.. method:: DjangoTestSuiteRunner.build_suite(test_labels, extra_tests=None, **kwargs)
...
...
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