mirror of
https://github.com/django/django.git
synced 2025-07-24 13:44:32 +00:00
Allowed a port range for the liveserver by default.
This is required for running tests in parallel.
This commit is contained in:
parent
e39dd61808
commit
326bc0955b
6 changed files with 23 additions and 9 deletions
|
@ -1227,7 +1227,11 @@ provided by the :setting:`TEST_RUNNER` setting.
|
|||
|
||||
The ``--liveserver`` option can be used to override the default address where
|
||||
the live server (used with :class:`~django.test.LiveServerTestCase`) is
|
||||
expected to run from. The default value is ``localhost:8081``.
|
||||
expected to run from. The default value is ``localhost:8081-8179``.
|
||||
|
||||
.. versionchanged:: 1.9
|
||||
|
||||
In earlier versions, the default value was ``localhost:8081``.
|
||||
|
||||
.. django-admin-option:: --keepdb
|
||||
|
||||
|
|
|
@ -1055,6 +1055,9 @@ Miscellaneous
|
|||
changed. They used to be ``(old_names, mirrors)`` tuples. Now they're just
|
||||
the first item, ``old_names``.
|
||||
|
||||
* By default :class:`~django.test.LiveServerTestCase` attempts to find an
|
||||
available port in the 8081-8179 range instead of just trying port 8081.
|
||||
|
||||
.. _deprecated-features-1.9:
|
||||
|
||||
Features deprecated in 1.9
|
||||
|
|
|
@ -812,11 +812,18 @@ This allows the use of automated test clients other than the
|
|||
client, to execute a series of functional tests inside a browser and simulate a
|
||||
real user's actions.
|
||||
|
||||
By default the live server's address is ``'localhost:8081'`` and the full URL
|
||||
can be accessed during the tests with ``self.live_server_url``. If you'd like
|
||||
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:
|
||||
By default the live server listens on ``localhost`` and picks the first
|
||||
available port in the ``8081-8179`` range. Its full URL can be accessed with
|
||||
``self.live_server_url`` during the tests.
|
||||
|
||||
.. versionchanged:: 1.9
|
||||
|
||||
In earlier versions, the live server's default address was always
|
||||
``'localhost:8081'``.
|
||||
|
||||
If you'd like to select another address then you may pass a different one to
|
||||
the :djadmin:`test` command via the :djadminopt:`--liveserver` option, for
|
||||
example:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue