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:36:51 -0500
commitf0780df608e2a8db487ac6e80d37d53d2912580d (patch)
tree0b138fd10333d09325873a50545039c08fda100a /docs/topics/testing
parent1feeefe918e0f6ea6d633855549310dd149baed5 (diff)
[1.8.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 38d3f95799..065c2a110e 100644
--- a/docs/topics/testing/tools.txt
+++ b/docs/topics/testing/tools.txt
@@ -766,9 +766,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
@@ -784,9 +784,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.
@@ -797,9 +797,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::
@@ -830,9 +830,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