Commit Graph

17 Commits

Author SHA1 Message Date
Jon Dufresne
ffe3dbb1b1 Perfer iter(dict) over iter(dict.keys()) (#5736)
Calling dict.keys() is unnecessary. The two are functionally equivalent
on modern Pythons.

Inspired by Lennart Regebro's talk "Prehistoric Patterns in Python" from
PyCon 2017.

https://www.youtube.com/watch?v=V5-JH23Vk0I
2018-01-08 09:49:46 +00:00
Ryan P Kilby
a91361dd2f Perform type check on passed request argument (#5618)
* Add test for wrapped request instance

* Add 'request' argument type check to Request init

* Fix metadata tests' request object
2017-11-23 08:57:31 +01:00
Artem Muterko
d0eb2e6cae Add remaining tests for metadata (#4855) 2017-01-27 09:25:51 +00:00
Asif Saifuddin Auvi
8fcb8d6350 converted metadata test asserts to pytest (#4806) 2017-01-12 08:21:15 +00:00
Tom Christie
9c996d7d2a Clean up existing deprecation warnings. (#4166)
* Add Meta.fields = '__all__' to serializer classes where required.
* Add explicit on_delete=models.CASCADE to ForeignKey fields.
* Use '.remote_field' and '.model' in preference to '.rel' and '.to' when inspecting model fields.
* Use new value_from_object in preference to internal _get_val_from_obj
2016-06-02 14:39:10 +01:00
Simon Charette
014e24b024 Do not list related field choices in OPTIONS requests.
Do not list related field choices in OPTIONS requests.
2016-06-01 16:33:03 +01:00
Tom Christie
806b0b34da Include nested objects in metadata for OPTIONS. Closes #3156. Closes #2915. 2015-07-16 15:17:18 +01:00
Julien Syx
2b979d4356 Adding recursion on child of List Field 2015-07-02 14:15:43 +02:00
José Padilla
7351a3f6ca Sort imports with isort 2015-06-25 16:55:51 -04:00
Jannon Frank
a97c989248 fix read_only related field metadata 2015-06-02 00:40:00 -07:00
Simon Charette
87208021e2 Metadata should detect null boolean field type. 2015-03-24 21:31:35 -04:00
Rense VanderHoek
9cb547b85f Validator-fix, added min/max fields to test_metadata 2015-02-20 17:34:49 +01:00
Brandon Cazander
ac87490b91 Clone the versioning_scheme when necessary. Fixes #2477 2015-01-27 17:10:17 -08:00
Brandon Cazander
6c083b12a1 Streamline test for #2455 2015-01-24 11:00:36 -08:00
Tom Christie
50db8c092a Minor test cleanup 2015-01-16 16:55:28 +00:00
Tom Christie
1420c76453 Ensure proper sorting of 'choices' attribute on ChoiceField 2014-09-25 10:49:25 +01:00
Tom Christie
f4b1dcb167 OPTIONS support 2014-09-24 14:09:49 +01:00