Commit Graph

23 Commits

Author SHA1 Message Date
Jon Dufresne
513a49d63b Drop default 'utf-8' to .encode()/.decode() (#6633)
A Python 3 cleanup that allows for less noise in the code.

https://docs.python.org/3/library/stdtypes.html#bytes.decode
https://docs.python.org/3/library/stdtypes.html#str.encode
2019-05-01 07:49:16 +02:00
Carlton Gibson
0407a0df8a
Dropped Python 2 compatibility. (#6615)
Thanks to Jon Dufresne (@jdufresne) for review.

Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Rizwan Mansuri <Rizwan@webbyfox.com>
2019-04-30 17:53:44 +02:00
Jon Dufresne
4d57d46bf8 Prefer io.BytesIO over six; available on all supported Pythons (#6168)
On all supported Pythons, the io.BytesIO is always a stream
implementation using an in-memory bytes buffer.

Makes code slightly more forward compatible by reducing use of the six
module and promotes more forward compatible practices in the docs.
2018-09-09 11:53:41 +01:00
Daniel Hahler
56967dbd90 Fix upload parser test (#6044) 2018-07-05 23:52:32 -04:00
Ryan P Kilby
8ab75a2f01 Add 'STRICT_JSON' API setting.
STRICT_JSON controls the renderer & parser behavior on whether or not
to accept non-standard float values (NaN, Infinity).
2017-09-25 09:08:20 +02:00
Artem Muterko
06afe6b1bf Convert tests to pytest style 2017-01-11 21:13:30 +02:00
Tom Christie
be74d11165 Fallback behavior for request parsing when request.POST already accessed. (#4500) 2016-09-21 11:49:09 +01:00
Tom Christie
3ef3fee926 Descriptive error from FileUploadParser when filename not included. (#4340)
* Descriptive error from FileUploadParser when filename not included.
* Consistent handling of upload filenames
2016-08-01 18:44:58 +01:00
José Padilla
7351a3f6ca Sort imports with isort 2015-06-25 16:55:51 -04:00
Tom Christie
1b398a20de Who care what we do when it's totally malformed? Not me. 2015-02-26 13:41:25 +00:00
Tom Christie
4b745eef3a Update test for more graceful 1.8 handling of malformed filename encodings 2015-02-26 13:25:14 +00:00
Tom Christie
39f26c9eca Merge master 2015-01-23 14:28:59 +00:00
Tom Christie
f1ac9d3f9b More graceful handling of malformed Content-Disposition 2015-01-23 12:26:44 +00:00
Tom Christie
baaa356489 Merge master 2014-12-12 15:37:43 +00:00
Tymur Maryokhin
d54c67d79d Removed custom StringIO, force_text, smart_text compat 2014-12-04 03:11:42 +01:00
Tom Christie
0359e9250d FileUploadParser. Raising StopFutureHandlers removes any handlers not yet run for the active set. Closes #2109. 2014-12-02 13:52:46 +00:00
José Padilla
7f9dc73672 Remove XML support from core 2014-11-29 14:57:51 -04:00
Jason Bittel
959e234260 Move parser tests to correct directory 2014-09-05 15:33:47 -07:00
Jason Bittel
c8e475023c Fix encoded filename parsing to allow for lang 2014-09-05 15:22:43 -07:00
Vladislav Vlastovskiy
644f9b5421 Removed assert for wrong charset 2014-09-05 14:51:31 -07:00
Vladislav Vlastovskiy
6e90dad8e3 Added test for encoded filename 2014-09-05 14:51:07 -07:00
Xavier Ordoquy
1797a74e82 Merge remote-tracking branch 'pelme/pytest' into feature/pytest
Conflicts:
	.travis.yml
	rest_framework/runtests/runtests.py
	tests/test_filters.py
	tests/test_pagination.py
	tox.ini
2014-04-17 09:53:44 +02:00
Andreas Pelme
971578ca34 Support for running the test suite with py.test
* Get rid of runtests.py
 * Moved test code  from rest_framework/tests and rest_framework/runtests to tests
 * Invoke py.test from setup.py
 * Invoke py.test from Travis
 * Invoke py.test from tox
 * Changed setUpClass to be just plain setUp in test_permissions.py
 * Updated contribution guideline to show how to invoke py.test
2014-03-02 12:40:30 +01:00