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
2e625095
Kaydet (Commit)
2e625095
authored
Ock 11, 2018
tarafından
Devin Mork
Kaydeden (comit)
Tim Graham
Ock 23, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Made instructions for shell launch in tutorial 5 more explicit.
üst
7d607127
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
tutorial05.txt
docs/intro/tutorial05.txt
+18
-4
No files found.
docs/intro/tutorial05.txt
Dosyayı görüntüle @
2e625095
...
...
@@ -135,7 +135,13 @@ the ``Question`` was published within the last day (which is correct) but also i
the ``Question``’s ``pub_date`` field is in the future (which certainly isn't).
To check if the bug really exists, using the Admin create a question whose date
lies in the future and check the method using the :djadmin:`shell`::
lies in the future and check the method using the :djadmin:`shell`:
.. console::
$ python manage.py shell
.. code-block:: pycon
>>> import datetime
>>> from django.utils import timezone
...
...
@@ -190,7 +196,9 @@ future. We then check the output of ``was_published_recently()`` - which
Running tests
-------------
In the terminal, we can run our test::
In the terminal, we can run our test:
.. console::
$ python manage.py test polls
...
...
@@ -215,7 +223,7 @@ and you'll see something like::
What happened is this:
* ``
python
manage.py test polls`` looked for tests in the ``polls`` application
* ``manage.py test polls`` looked for tests in the ``polls`` application
* it found a subclass of the :class:`django.test.TestCase` class
...
...
@@ -335,7 +343,13 @@ or even in the :djadmin:`shell`.
We will start again with the :djadmin:`shell`, where we need to do a couple of
things that won't be necessary in ``tests.py``. The first is to set up the test
environment in the :djadmin:`shell`::
environment in the :djadmin:`shell`:
.. console::
$ python manage.py shell
.. code-block:: pycon
>>> from django.test.utils import setup_test_environment
>>> setup_test_environment()
...
...
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