summaryrefslogtreecommitdiff
path: root/tests/servers
AgeCommit message (Collapse)Author
2021-02-12[3.2.x] Fixed #32437 -- Fixed cleaning up ALLOWED_HOSTS in ↵Chris Jerdonek
LiveServerTestCase on setUpClass() failure. Backport of 694deff82f86e025561dfa724425f67e2ff7cbb7 from master
2020-12-15Fixed typo in tests/servers/tests.py.Mariusz Felisiak
2020-12-14Fixed #32240 -- Made runserver suppress ↵Petter Strandmark
ConnectionAbortedError/ConnectionResetError errors. See https://bugs.python.org/issue27682 and https://github.com/python/cpython/pull/9713
2020-12-14Refs #4444 -- Added tests for handling broken pipe errors in WSGIServer.Petter Strandmark
2020-12-10Fixed #32178 -- Allowed database backends to skip tests and mark expected ↵Hasan Ramezani
failures. Co-authored-by: Tim Graham <timograham@gmail.com>
2019-11-18Replaced unnecessary str()/bytes() calls with literals.Jon Dufresne
2019-07-10Fixed #30619 -- Made runserver --nothreading use single threaded WSGIServer.atsuo ishimoto
Browsers often use multiple connections with Connection: keep-alive. If --nothreading is specified, the WSGI server cannot accept new connections until the old connection is closed, causing hangs. Force Connection: close when --nothreading option is used.
2019-02-14Fixed #30171 -- Fixed DatabaseError in servers tests.Jon Dufresne
Made DatabaseWrapper thread sharing logic reentrant. Used a reference counting like scheme to allow nested uses. The error appeared after 8c775391b78b2a4a2b57c5e89ed4888f36aada4b.
2019-02-09Removed default empty content argument from HttpResponse calls.Jon Dufresne
2019-01-28Fixed #30137 -- Replaced OSError aliases with the canonical OSError.Jon Dufresne
Used more specific errors (e.g. FileExistsError) as appropriate.
2019-01-10Refs #28478 -- Deprecated TestCase's allow_database_queries and multi_db in ↵Simon Charette
favor of databases.
2018-12-31Updated test URL patterns to use path() and re_path().Tim Graham
2018-12-19Fixed #30015 -- Ensured request body is properly consumed for keep-alive ↵Konstantin Alekseev
connections.
2018-11-27Made reused RequestFactory instances class attributes.Simon Charette
2018-11-10Fixed keep-alive support in manage.py runserver.Florian Apolloner
Ticket #25619 changed the default protocol to HTTP/1.1 but did not properly implement keep-alive. As a "fix" keep-alive was disabled in ticket #28440 to prevent clients from hanging (they expect the server to send more data if the connection is not closed and there is no content length set). The combination of those two fixes resulted in yet another problem: HTTP/1.1 by default allows a client to assume that keep-alive is supported unless the server disables it via 'Connection: close' -- see RFC2616 8.1.2.1 for details on persistent connection negotiation. Now if the client receives a response from Django without 'Connection: close' and immediately sends a new request (on the same tcp connection) before our server closes the tcp connection, it will error out at some point because the connection does get closed a few milli seconds later. This patch fixes the mentioned issues by always sending 'Connection: close' if we cannot determine a content length. The code is inefficient in the sense that it does not allow for persistent connections when chunked responses are used, but that should not really cause any problems (Django does not generate those) and it only affects the development server anyways. Refs #25619, #28440.
2018-05-07Captured logging in tests with self.assertLogs().Claude Paroz
2018-05-07Replaced django.test.utils.patch_logger() with assertLogs().Claude Paroz
Thanks Tim Graham for the review.
2017-10-13Refs #28440 -- Fixed server connection closing test on macOS.Tom
2017-09-25Fixed #27857 -- Dropped support for Python 3.4.Tim Graham
2017-09-12Fixed #28440 -- Fixed WSGIServer hang on responses without a Content-Length.Tom
Disabled keep-alive to fix the regression in e6065c7b8363202c5eb13ba10c97a8c24d014b45.
2017-06-05Fixed ResourceWarnings in tests/servers/tests.py.Jon Dufresne
e.g. ResourceWarning: unclosed <socket.socket [closed] fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6>
2017-05-30Fixed #28212 -- Allowed customizing the port that LiveServerTestCase uses.Robert Rollins
Forwardport of 877d7b71ae952b3bc946e5187d6c23039a71614d from stable/1.11.x
2017-05-27Fixed #28249 -- Removed unnecessary dict.keys() calls.Jon Dufresne
iter(dict) is equivalent to iter(dict.keys()).
2017-05-10Decreased max_length for char fields unless absolutely needed. (#8485)Florian Apolloner
2017-02-23Fixed #25619 -- Made runserver serve with HTTP 1.1 protocolClaude Paroz
Thanks Tim Graham for the review.
2017-02-09Fixed #20238 -- Added threading support to LiveServerTestCase.Nadège Michel
2017-02-09Refs #23919 -- Removed default 'utf-8' argument for str.encode()/decode().Tim Graham
2017-01-26Refs #23919 -- Replaced usage of django.utils.http utilities with Python ↵Claude Paroz
equivalents Thanks Tim Graham for the review.
2017-01-25Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand
2017-01-20Refs #23919 -- Removed unneeded str() callsClaude Paroz
2017-01-20Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.Tim Graham
These functions do nothing on Python 3.
2017-01-19Refs #23919 -- Removed str() conversion of type and method __name__.Simon Charette
2017-01-19Refs #23919 -- Removed obsolete contextlib.closing() calls (for Python 2).Tim Graham
2017-01-19Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette
2017-01-18Refs #23919 -- Removed most of remaining six usageClaude Paroz
Thanks Tim Graham for the review.
2017-01-18Refs #23919 -- Removed six.<various>_types usageClaude Paroz
Thanks Tim Graham and Simon Charette for the reviews.
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2016-11-10Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.za
2016-08-19Fixed #22414 -- Ensured that LiveServerTestCase closes connections.Chris Jerdonek
2016-08-08Refs #27025 -- Fixed a servers test on Python 3.6.Tim Graham
After https://hg.python.org/cpython/rev/4ea79767ff75/, test_strips_underscore_headers fails with: 'Stub' object has no attribute 'sendall'.
2016-06-23Fixed #26791 -- Replaced LiveServerTestCase port ranges with binding to port 0.Tim Graham
2016-06-16Fixed flake8 2.6 warnings.Tim Graham
2016-02-08Refs #25684 -- Silenced logging output in servers tests.Tim Graham
2016-01-11Fixed #25684 -- Made runserver use logging for request/response output.Flavio Curella
Thanks andreif for the contributing to the patch.
2016-01-02Refs #26011 -- Fixed AttributeError in test_port_bind test.Marten Kenbeek
2015-12-31Fixed #26011 -- Prevented random LiveServerTestCase test failures on Windows.Marten Kenbeek
Prevented LiveServerTestCase from stealing ports used by concurrent processes on Windows.
2015-08-01Fixed #25204 -- Added missing space in runserver logging.Tim Graham
2015-07-20Replaced six.BytesIO with io.BytesIOTim Graham
2015-07-06Fixed some unclosed objects in testsAndriy Sokolovskiy
2015-06-12Fixed #24965 -- Made LiveServerTestCase.live_server_url accessible from classMoritz Sichert