summaryrefslogtreecommitdiff
path: root/tests/test_client
Commit message (Collapse)AuthorAgeFilesLines
* Refs #34482 -- Reverted "Fixed #32969 -- Fixed pickling HttpResponse and ↵Mariusz Felisiak2023-04-121-9/+13
| | | | | | | | subclasses." This reverts commit d7f5bfd241666c0a76e90208da1e9ef81aec44db. Thanks Márton Salomváry for the report.
* Refs #33865 -- Improved implementation of FakePayload.Nick Pope2023-01-051-4/+6
| | | | | | | | | | | | | | | | FakePayload is a wrapper around io.BytesIO and is expected to masquerade as though it is a file-like object. For that reason it makes sense that it should inherit the correct signatures from io.BytesIO methods. Crucially an implementation of .readline() is added which will be necessary for this to behave more like the expected file-like objects as LimitedStream will be changed to defer to the wrapped stream object rather than rolling its own implementation for improved performance. It should be safe to adjust these signatures because FakePayload is only used internally within test client helpers, is undocumented, and thus private.
* Refs #34074 -- Used headers argument for RequestFactory and Client in docs ↵David Wobrock2023-01-041-4/+8
| | | | and tests.
* Fixed #34074 -- Added headers argument to RequestFactory and Client classes.David Wobrock2022-11-141-0/+58
|
* Updated documentation and comments for RFC updates.Nick Pope2022-11-101-2/+1
| | | | | | | | | | | | | | | - Updated references to RFC 1123 to RFC 5322 - Only partial as RFC 5322 sort of sub-references RFC 1123. - Updated references to RFC 2388 to RFC 7578 - Except RFC 2388 Section 5.3 which has no equivalent. - Updated references to RFC 2396 to RFC 3986 - Updated references to RFC 2616 to RFC 9110 - Updated references to RFC 3066 to RFC 5646 - Updated references to RFC 7230 to RFC 9112 - Updated references to RFC 7231 to RFC 9110 - Updated references to RFC 7232 to RFC 9110 - Updated references to RFC 7234 to RFC 9111 - Tidied up style of text when referring to RFC documents
* Fixed #34063 -- Fixed reading request body with async request factory and ↵Scott Halgrim2022-11-082-0/+20
| | | | | | | client. Co-authored-by: Kevan Swanberg <kevswanberg@gmail.com> Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
* Fixed #32969 -- Fixed pickling HttpResponse and subclasses.Anv3sh2022-06-203-0/+22
|
* Removed 'tests' path prefix in a couple tests.Tim Graham2022-05-021-2/+2
|
* Fixed #33348 -- Changed ↵Baptiste Mispelon2022-04-061-10/+14
| | | | | | | SimpleTestCase.assertFormError()/assertFormsetErrors() to take form/formset. Instead of taking a response object and a context name for the form/formset, the two methods now take the object directly.
* Moved remaining SimpleTestCase.assertFormError()/assertFormsetErrors() tests ↵Mariusz Felisiak2022-04-052-44/+0
| | | | | | | to test_utils. This also removes redundant tests in test_client_regress. Follow up to 68144f40490b2572c8da4341742b9e387e3f6bdd.
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-071-3/+10
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-076-540/+643
|
* Adjusted CBV resolver_match example in testing tools docs.Carlton Gibson2022-01-261-0/+9
| | | | The view_class is available on the view callback, allowing that to be checked, rather than the __name__.
* Refs #32956 -- Capitalized HTTP/HTTPS in comments, docs, and docstrings.David Smith2021-10-201-2/+2
|
* Fixed #33132 -- Fixed test client handling of querystring only redirects.Jaap Roes2021-09-243-0/+23
| | | | Regression in 1e5aa8e1c79252cc810af21294a6e945d11d37b3.
* Fixed #32929 -- Fixed handling query strings in AsyncRequestFactory.pochangl2021-07-151-0/+9
|
* Fixed ResourceWarning in ↵Mariusz Felisiak2021-06-241-2/+5
| | | | test_client.tests.ClientTest.test_uploading_named_temp_file().
* Fixed #32790 -- Ensured test Client handles redirects to domain indexes ↵tomhamiltonstubber2021-06-233-1/+25
| | | | without a specified trailing slash.
* Fixed #32470 -- Fixed ResolverMatch instance on test clients when ↵Marc Gibbons2021-02-232-1/+42
| | | | request.urlconf is set.
* Fixed #32159 -- Ensured AsyncRequestFactory correctly sets headers.Carlton Gibson2020-11-041-0/+11
|
* Fixed #32162 -- Fixed setting Content-Length header in AsyncRequestFactory.Patrick Arminio2020-11-031-0/+15
|
* Refs #25780 -- Removed redundant status code assertions from tests.Jon Dufresne2020-10-281-7/+3
|
* Simplifed formset iteration using enumerate().Jon Dufresne2020-10-261-2/+1
|
* Fixed #31789 -- Added a new headers interface to HttpResponse.Tom Carrick2020-09-142-2/+2
|
* Fixed #31494 -- Preserved query strings when following HTTP 307/308 ↵Ahmad A. Hussein2020-05-271-0/+14
| | | | redirects in test client.
* Refs #31494 -- Added test for query strings for GET/HEAD requests when ↵Ahmad A. Hussein2020-05-273-0/+30
| | | | following HTTP 307/308 redirects in test client.
* Changed django.forms.ValidationError imports to ↵François Freitag2020-04-281-1/+2
| | | | | | django.core.exceptions.ValidationError. Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
* Fixed #31224 -- Added support for asynchronous views and middleware.Andrew Godwin2020-03-183-2/+63
| | | | | This implements support for asynchronous views, asynchronous tests, asynchronous middleware, and an asynchronous test client.
* Fixed #30677 -- Improved error message for urlencode() and Client when None ↵swatantra2019-08-111-4/+4
| | | | is passed as data.
* Cleaned up exception message checking in some tests.Jon Dufresne2019-03-151-1/+2
|
* Fixed #18707 -- Added support for the test client to return 500 responses.Jon Dufresne2019-02-201-0/+14
|
* Fixed grammar in FakePayload exception message.Jon Dufresne2019-01-251-0/+11
|
* Updated test URL patterns to use path() and re_path().Tim Graham2018-12-311-39/+39
|
* Fixed #30024 -- Made urlencode() and Client raise TypeError when None is ↵Jon Dufresne2018-12-271-0/+16
| | | | passed as data.
* Made reused RequestFactory instances class attributes.Simon Charette2018-11-271-3/+1
|
* Fixed #29687 -- Allowed the test client to serialize list/tuple as JSON.Dan Palmer2018-08-252-8/+15
|
* Fixed #29553 -- Made test client set Content-Length header to a string ↵Tim Graham2018-07-091-1/+1
| | | | rather than integer.
* Fixed #27398 -- Added an assertion to compare URLs, ignoring the order of ↵Jan Pieter Waagmeester2018-06-201-0/+6
| | | | their query strings.
* Fixed hanging indentation in various code.Mariusz Felisiak2018-03-161-2/+1
|
* Added a test for Client.generic() data coercion.Tim Graham2018-02-122-1/+11
| | | | | The smart_str() call (now force_bytes()) added in e73838b6ddcc7b37c03f9eee04fa6e6a283fedb3 is otherwise untested.
* Refs #20530 -- Added a test for test client query string encoding.Tim Graham2018-02-121-0/+5
| | | | | 7bb627936034c1b9500a8d250cce75b30f980b23 is only tested in django-contrib-comments.
* Fixed #29082 -- Allowed the test client to encode JSON request data.Nick Sarbicki2018-02-063-0/+41
|
* Fixed #27999 -- Added test client support for HTTP 307 and 308 redirects.Tom2018-02-063-0/+61
|
* Fixed #28837 -- Fixed test client crash if an exception with more than one ↵Nicolas Delaby2017-11-283-1/+16
| | | | | | | | arg is raised. Also removed usage of the problematic pattern elsewhere. Regression in 6e55e1d88a5c4453e25f0caf7ffb68973de5c0ba.
* Fixed #28249 -- Removed unnecessary dict.keys() calls.Jon Dufresne2017-05-271-1/+1
| | | iter(dict) is equivalent to iter(dict.keys()).
* Refs #23919 -- Removed misc Python 2/3 references.Tim Graham2017-01-251-10/+1
|
* Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette2017-01-192-2/+2
|
* Refs #23919 -- Removed most of remaining six usageClaude Paroz2017-01-181-1/+1
| | | | Thanks Tim Graham for the review.
* Refs #23919 -- Removed encoding preambles and future importsClaude Paroz2017-01-182-5/+0
|
* Refs #27184 -- Fixed unclosed file ResourceWarning in test_client test.Jon Dufresne2016-12-121-2/+2
|