Commit Graph

8290 Commits

Author SHA1 Message Date
Ryan P Kilby
33f8910b26
Fix deprecation warnings in tests (#6076)
* Fix deprecated arguments in schema tests

* Update optional reqs, fixing markdown deprecation
2018-07-09 23:56:52 -04:00
Eze Sunday
a0277919f0 Fix grammar mistake in html-and-forms.md (#6070) 2018-07-08 16:11:05 -04:00
Ryan P Kilby
38b3d0109b Only catch TypeError/ValueError for object lookups (#6028)
* Only catch TypeError/ValueError for object lookups

* Test wrapped TypeError/ValueError handling

* Raise NotImplementedError in tests instead of pass
2018-07-06 12:18:17 +02:00
Ryan P Kilby
a628a2dbce Drop Django 1.10 support (#5657)
* Remove Django 1.10 from CI

* Remove Django 1.10 compat code
2018-07-06 12:14:31 +02:00
Ryan P Kilby
9b8af04e7f Move guardian imports out of compat (#6054) 2018-07-06 11:32:02 +02:00
Ryan P Kilby
99ca078ebb Add "Community" section to docs, minor cleanup (#5993)
* Add 'Community' tab to navigation, move articles

* Drop DRF 2.x announcements and the docs note

* Drop embedded tutorial/guide/topics links

* Conver mixture of tabs/spaces => spaces

* Fix topics/community links
2018-07-06 11:28:18 +02:00
Ryan P Kilby
7095021db7 Rename base_name => basename for consistency's sake (#5990)
* Rename base_name => basename for consistency

* Update tests to use basename
2018-07-06 11:03:12 +02:00
Ryan P Kilby
f89cc066bc Admin renderer urls (#5988)
* Make admin detail link have small width

* Disable admin detail link when no URL

* Add 'AdminRenderer.get_result_url'

Attempts to reverse the result's detail view URL.
2018-07-06 10:58:26 +02:00
Daniel Hahler
3578bd6883 get_error_detail: use error_dict/error_list (#5785) 2018-07-06 10:44:58 +02:00
Ryan P Kilby
6511b52cca Fix schemas for extra actions (#5992)
* Add failing test for extra action schemas

* Add ViewInspector setter to store instances

* Fix schema disabling for extra actions

* Add docs note about disabling schemas for actions
2018-07-06 10:35:36 +02:00
Daniel Hahler
b23cdaff4c tox/pytest: move posargs, use -ra (#6039)
- tox: move {posargs} to the end, so that it can override previous
  entries, e.g. `-ra` when `-rw` was used.
- pytest: add `-ra` to addopts: it is good to see a summary of skipped
  and failed tests at the end.
2018-07-06 10:34:11 +02:00
Ryan P Kilby
0148a9f8da Improvements to ViewSet extra actions (#5605)
* View suffix already set by initializer

* Add 'name' and 'description' attributes to ViewSet

ViewSets may now provide their `name` and `description` attributes
directly, instead of relying on view introspection to derive them.
These attributes may also be provided with the view's initkwargs.

The ViewSet `name` and `suffix` initkwargs are mutually exclusive.

The `action` decorator now provides the `name` and `description` to
the view's initkwargs. By default, these values are derived from the
method name and its docstring. The `name` may be overridden by providing
it as an argument to the decorator.

The `get_view_name` and `get_view_description` hooks now provide the
view instance to the handler, instead of the view class. The default
implementations of these handlers now respect the `name`/`description`.

* Add 'extra actions' to ViewSet & browsable APIs

* Update simple router tests

Removed old test logic around link/action decorators from `v2.3`. Also
simplified the test by making the results explicit instead of computed.

* Add method mapping to ViewSet actions

* Document extra action method mapping
2018-07-06 10:33:10 +02:00
Daniel Hahler
56967dbd90 Fix upload parser test (#6044) 2018-07-05 23:52:32 -04:00
Ryan P Kilby
0e10d32fb1
Add NotImplementedError to coverage exclusion (#6057) 2018-06-24 17:56:31 -04:00
Ryan P Kilby
c5ab65923f
tests/test_permissions.py: do not add view perm for dj21 (#6055) 2018-06-23 07:31:06 -04:00
Daniel Hahler
499533d219 Use [tool:pytest] header in setup.cfg (#6045) 2018-06-22 18:14:26 -04:00
Chris Shyi
d9f541836b Update to Django 2.0 Routing Syntax (#6049) 2018-06-22 10:28:59 +02:00
Ryan P Kilby
1a170438d2 Add "optionals not required" build (#6047) 2018-06-22 10:16:57 +02:00
Daniel Hahler
7e0ad9262e tests: update pytest/pytest-django (#6042) 2018-06-21 16:23:52 -04:00
Daniel Hahler
a44cb67988 tests: fix usage of transaction.non_atomic_requests (#6043) 2018-06-21 14:44:58 -04:00
Daniel Hahler
06526cafe5 runtests.py: clean up PYTEST_ARGS (#6040)
1. `tests` and `--tb=short` is not necessary, since it is in
`pytest.addopts` already.
2. removes `-s` (shortcut for --capture=no): it is typically a good idea
   to not display output from successful tests.
2018-06-21 14:28:25 +01:00
Çağıl
8f55cd8db5 Fix url for group_names action example (#6036) 2018-06-21 04:29:05 -04:00
Asif Saifuddin Auvi
d778c5e51e Update tox to use Django v2.1b1 (#6037) 2018-06-21 09:07:33 +02:00
William S. Vincent
feffa109a8 Add REST APIs with Django book (#6033)
Just published book dedicated to DRF.
2018-06-20 00:24:26 +01:00
Xavier Ordoquy
3fcc076d91
Merge pull request #6024 from tveastman/master
Documentation: Correct the signature for HyperlinkedRelatedField.get_object()
2018-06-13 07:43:35 +02:00
Tom Eastman
be2bcf7e3f Documentation: Correct the signature for HyperlinkedRelatedField.get_object() 2018-06-13 16:39:28 +12:00
Emeka Icha
a21484d90e (fix) link to disqus article on cursor pagination (#6020) 2018-06-12 10:34:28 +01:00
Xavier Ordoquy
8688c99602
Merge pull request #6019 from jdufresne/pypi-register
Update incorrect PyPI URL to register an account
2018-06-10 09:49:16 +02:00
Jon Dufresne
89fb0b0f99 Update incorrect PyPI URL to register an account
To register an account on PyPI, the URL is
https://pypi.org/account/register/, which changed after the move to
pypi.org.
2018-06-09 19:09:31 -07:00
Tom Christie
26b0f650d6
Update LICENSE.md 2018-06-04 09:16:18 +01:00
Tom Christie
206423009b
Update LICENSE.md 2018-06-04 09:15:05 +01:00
Steven Loria
cf925caa48 Render markdown readme on PyPI (#6004)
* Render markdown readme on PyPI

PyPI now supports GitHub-flavored Markdown descriptions
(https://blog.thea.codes/github-flavored-markdown-on-pypi/),
so there's no need to convert the README to rst with pypandoc
any more.

* Remove readme checking

Checking markdown descriptions is not necessary.
See https://github.com/pypa/readme_renderer#markdown

* Upgrade twine
2018-06-03 19:21:04 +01:00
Matt Layman
f67d23c441 Add docs link to Caching API Guide. (#6012) 2018-05-31 09:58:02 +02:00
Teppei Fukuda
fe54575e6a Fix exceptions.md (#6003) 2018-05-25 10:42:22 +01:00
Xavier Ordoquy
a7cd1dbc43
Merge pull request #6001 from auvipy/master
updated tox and travis for django 2.1 alpha1
2018-05-23 21:10:27 +02:00
Asif Saifuddin Auvi
2634294667 updated tox and travis for django 2.1 alpha1 2018-05-23 16:33:15 +06:00
int3l
1ee3829a2f Update the http signature auth library ref link (#5997)
* Update the http signature auth library ref link

It seems that the djangorestframework-httpsignature package is outdated
and there is updated fork named drf-httpsig.

* Fixing the link ref format in the http signature section
2018-05-22 12:22:09 +01:00
Tamirlan Omarov
edfcbe076d Added pagination section to the quickstart page (#5987) 2018-05-21 13:32:07 +01:00
John Franey
f20e282d15 Update documenting-your-api.md (#5991)
Fix link to "Schemas as Documentation: Examples"
2018-05-17 00:36:41 -04:00
Eduardo GP
ff4429fad4 fix e.indexOf is not a function error (#5982) 2018-05-11 21:49:29 +01:00
Craig de Stigter
9629886915 Fixed AttributeError from items filter when value is None (#5981) 2018-05-11 08:50:08 +02:00
Daniel Hahler
c17b4ad0d0 Include coverage for tests (#5970)
It is useful to see if tests itself are covered after all - missing
coverage there typically indicates dead/missed code paths.

This also uses `source=.` and includes (with run and report), to help
Codecov with reporting.
Ref: https://github.com/encode/django-rest-framework/pull/5956
2018-05-08 14:02:45 +01:00
Daniel Hahler
275c157341 tests: remove some dead code, use assert 0 for never called methods (#5973)
* tests: remove some dead code, use `assert 0` for never called methods

* fixup! tests: remove some dead code, use `assert 0` for never called methods
2018-05-08 13:28:46 +01:00
Daniel Hahler
4527a753cd Move pytest config to setup.cfg (#5979)
Also adds `testspath` to improve test collection performance.
2018-05-08 13:28:16 +01:00
Daniel Hahler
fca39f9dbb tests: fix test_write_only_fields not being executed (#5971)
This adds the required `test_` prefix.
2018-05-08 09:27:35 +01:00
Daniel Hahler
4c29752b6a requirements-testing: update pytest and pytest-django (#5972) 2018-05-08 09:27:25 +01:00
Tom Christie
da4ecfddc2
Update .gitignore 2018-05-08 09:21:32 +01:00
Tom Christie
6957aaae85
Delete config 2018-05-08 09:20:01 +01:00
Tom Christie
0218f20ac4
Delete .editorconfig 2018-05-08 09:19:31 +01:00
Ari Rouvinen
45acfe05b4 Add missing comma (#5978) 2018-05-08 09:15:59 +01:00