diff options
| author | Carlton Gibson <carlton.gibson@noumenal.es> | 2023-02-09 16:48:46 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-02-10 19:19:13 +0100 |
| commit | 534ac4829764f317cf2fbc4a18354fcc998c1425 (patch) | |
| tree | c85c1df220ea6c3a87f9820106ba5a06e9ec9394 /docs/intro/tutorial05.txt | |
| parent | 7bb741d787ba360a9f0d490db92e22e0d28204ed (diff) | |
Refs #34140 -- Applied rst code-block to non-Python examples.
Thanks to J.V. Zammit, Paolo Melchiorre, and Mariusz Felisiak for
reviews.
Diffstat (limited to 'docs/intro/tutorial05.txt')
| -rw-r--r-- | docs/intro/tutorial05.txt | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/docs/intro/tutorial05.txt b/docs/intro/tutorial05.txt index 4431af71ad..8eff8bf9d4 100644 --- a/docs/intro/tutorial05.txt +++ b/docs/intro/tutorial05.txt @@ -206,7 +206,9 @@ In the terminal, we can run our test: $ python manage.py test polls -and you'll see something like:: +and you'll see something like: + +.. code-block:: shell Creating test database for alias 'default'... System check identified no issues (0 silenced). @@ -267,7 +269,9 @@ past: now = timezone.now() return now - datetime.timedelta(days=1) <= self.pub_date <= now -and run the test again:: +and run the test again: + +.. code-block:: pytb Creating test database for alias 'default'... System check identified no issues (0 silenced). @@ -376,13 +380,17 @@ it earlier, check it before continuing. 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):: +this won't be required): + +.. code-block:: pycon >>> from django.test import Client >>> # create an instance of the client for our use >>> client = Client() -With that ready, we can ask the client to do some work for us:: +With that ready, we can ask the client to do some work for us: + +.. code-block:: pycon >>> # get a response from '/' >>> response = client.get('/') |
