summaryrefslogtreecommitdiff
path: root/tests/servers
AgeCommit message (Collapse)Author
2019-02-14[2.2.x] Fixed #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. Backport of 76990cbbda5d93fda560c8a5ab019860f7efaab7 from master.
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
2015-05-20Refs #24652 -- Used SimpleTestCase where appropriate.Simon Charette
2015-02-19Fixed typo in error message in the test.Tim Graham
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-01-13Stripped headers containing underscores to prevent spoofing in WSGI environ.Carl Meyer
This is a security fix. Disclosure following shortly. Thanks to Jedediah Smith for the report.
2014-11-29Fixed #23930 -- Added copies of captured_std* managers from CPython's ↵wrwrwr
test.support. StringIO import was adapted for compatibility with Python 2.
2014-11-03Fixed #21281 -- Made override_settings act at class level when used as a ↵Thomas Chaumeny
TestCase decorator.
2014-09-09Fixed #23398 -- Added helpful error message when runserver is accessed via HTTPSFlavio Curella
2014-04-06Fixed #21977 -- Deprecated SimpleTestCase.urlsAnubhav Joshi
2014-04-03Fixed #22218 -- Deprecated django.conf.urls.patterns.Tim Graham
Thanks Carl Meyer for the suggestion and Alex Gaynor and Carl for reviews.