1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

[1.7.x] Fixed #24358 -- Corrected code-block directives for console sessions.

Backport of eba6dff581 from master
This commit is contained in:
Sean Wang
2015-02-18 19:19:21 -08:00
committed by Tim Graham
parent c231ec1af0
commit a3f7b034d7
14 changed files with 65 additions and 65 deletions

View File

@@ -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