* fix: MultipleChoiceField use ordered sort
(cherry picked from commit 8436483e66af3d1317d99335b7fae95c1f58d13a)
* test: fix unit tests
(cherry picked from commit 6428ac4a05f4a33eb0813cc56d584f56e7bfac89)
* test: test TestMultipleChoiceField can json serializable
(cherry picked from commit 12908b149c446598682269f8df78290fa8268982)
* test: fix unit test
(cherry picked from commit 73a709c4b04ae510d61f2d426f93f6aef98b09fd)
* minor: rest old formatting
* fix: using pytest.fail to test
* Update test_fields.py
* Update test_fields.py
* Update test_fields.py
* test: add test cases
* docs: update docs
* Update docs/api-guide/fields.md
* Skip inner list allocation
* Fix punctuation
---------
Co-authored-by: Asif Saif Uddin {"Auvi":"অভি"} <auvipy@gmail.com>
Co-authored-by: Bruno Alla <browniebroke@users.noreply.github.com>
Co-authored-by: Bruno Alla <alla.brunoo@gmail.com>
* Add tests for raise_errors_on_nested_writes
* Fix dotted-source field checking on serializer write
The code was previously checking the validated data for the field's
attribute name, however, the data contain the first source attr.
Set literals are available on all supported Python versions. They are
idiomatic and always faster:
$ python3 -m timeit '{}'
10000000 loops, best of 3: 0.0357 usec per loop
$ python3 -m timeit 'dict()'
10000000 loops, best of 3: 0.104 usec per loop
$ python3 -m timeit '{1, 2, 3}'
10000000 loops, best of 3: 0.0754 usec per loop
$ python3 -m timeit 'set([1, 2, 3])'
1000000 loops, best of 3: 0.228 usec per loop
It is possible that a key in a MultiValueDict has multiple values, lists
are represented this way. When accessing a key in a MultiValueDict
it only returns the last element of that key. This becomes a problem
when parsing an html dict with a list inside of it.
To fix this problem we have to get and set the value using .getlist()
and .setlist().
* 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