summaryrefslogtreecommitdiff
path: root/docs/topics/testing
diff options
context:
space:
mode:
authorSean Wang <sean@decrypted.org>2015-02-18 19:19:21 -0800
committerTim Graham <timograham@gmail.com>2015-02-22 09:38:54 -0500
commita3f7b034d7a8dacc117fef4d2237d63ec2274cba (patch)
treee28d0ad56ac06ee92d88b54e627b2fc4f2129491 /docs/topics/testing
parentc231ec1af0c40f17b67fbd6d6af34b2d8b7a9616 (diff)
[1.7.x] Fixed #24358 -- Corrected code-block directives for console sessions.
Backport of eba6dff581aa8bd6a1c08456e83e68ad09ae4ec3 from master
Diffstat (limited to 'docs/topics/testing')
-rw-r--r--docs/topics/testing/tools.txt16
1 files changed, 8 insertions, 8 deletions
diff --git a/docs/topics/testing/tools.txt b/docs/topics/testing/tools.txt
index fcb7775c7f..99a4634c1c 100644
--- a/docs/topics/testing/tools.txt
+++ b/docs/topics/testing/tools.txt
@@ -677,9 +677,9 @@ to change the default address (in the case, for example, where the 8081 port is
already taken) then you may pass a different one to the :djadmin:`test` command
via the :djadminopt:`--liveserver` option, for example:
-.. code-block:: bash
+.. code-block:: console
- ./manage.py test --liveserver=localhost:8082
+ $ ./manage.py test --liveserver=localhost:8082
Another way of changing the default server address is by setting the
`DJANGO_LIVE_TEST_SERVER_ADDRESS` environment variable somewhere in your
@@ -697,9 +697,9 @@ tests might randomly fail with an "Address already in use" error. To avoid this
problem, you can pass a comma-separated list of ports or ranges of ports (at
least as many as the number of potential parallel processes). For example:
-.. code-block:: bash
+.. code-block:: console
- ./manage.py test --liveserver=localhost:8082,8090-8100,9000-9200,7041
+ $ ./manage.py test --liveserver=localhost:8082,8090-8100,9000-9200,7041
Then, during test execution, each new live test server will try every specified
port until it finds one that is free and takes it.
@@ -710,9 +710,9 @@ To demonstrate how to use ``LiveServerTestCase``, let's write a simple Selenium
test. First of all, you need to install the `selenium package`_ into your
Python path:
-.. code-block:: bash
+.. code-block:: console
- pip install selenium
+ $ pip install selenium
Then, add a ``LiveServerTestCase``-based test to your app's tests module
(for example: ``myapp/tests.py``). The code for this test may look as follows:
@@ -745,9 +745,9 @@ Then, add a ``LiveServerTestCase``-based test to your app's tests module
Finally, you may run the test as follows:
-.. code-block:: bash
+.. code-block:: console
- ./manage.py test myapp.tests.MySeleniumTests.test_login
+ $ ./manage.py test myapp.tests.MySeleniumTests.test_login
This example will automatically open Firefox then go to the login page, enter
the credentials and press the "Log in" button. Selenium offers other drivers in