aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/tests/generics.py
diff options
context:
space:
mode:
authorTom Christie2013-05-24 21:21:56 +0100
committerTom Christie2013-05-24 21:21:56 +0100
commit760e8642bd04b5e03409601a8d378799c36eac1b (patch)
tree69857f97ba5702fe040167a058fae0431abfe588 /rest_framework/tests/generics.py
parent78c53d530ff3d7a4a443b104ad73952d0b5b5b8b (diff)
parenta1deb5eac7d6d00c6269d88fce1cc6818d8ec04a (diff)
downloaddjango-rest-framework-760e8642bd04b5e03409601a8d378799c36eac1b.tar.bz2
Merge branch 'issue-192-expose-fields-for-options' of https://github.com/grimborg/django-rest-framework into improved-options-support
Diffstat (limited to 'rest_framework/tests/generics.py')
-rw-r--r--rest_framework/tests/generics.py36
1 files changed, 34 insertions, 2 deletions
diff --git a/rest_framework/tests/generics.py b/rest_framework/tests/generics.py
index 15d87e86..a2f8fb4b 100644
--- a/rest_framework/tests/generics.py
+++ b/rest_framework/tests/generics.py
@@ -121,7 +121,22 @@ class TestRootView(TestCase):
'text/html'
],
'name': 'Root',
- 'description': 'Example description for OPTIONS.'
+ 'description': 'Example description for OPTIONS.',
+ 'actions': {}
+ }
+ expected['actions']['GET'] = {}
+ expected['actions']['POST'] = {
+ 'text': {
+ 'max_length': 100,
+ 'read_only': False,
+ 'required': True,
+ 'type': 'String',
+ },
+ 'id': {
+ 'read_only': True,
+ 'required': False,
+ 'type': 'Integer',
+ },
}
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data, expected)
@@ -238,8 +253,25 @@ class TestInstanceView(TestCase):
'text/html'
],
'name': 'Instance',
- 'description': 'Example description for OPTIONS.'
+ 'description': 'Example description for OPTIONS.',
+ 'actions': {}
}
+ for method in ('GET', 'DELETE'):
+ expected['actions'][method] = {}
+ for method in ('PATCH', 'PUT'):
+ expected['actions'][method] = {
+ 'text': {
+ 'max_length': 100,
+ 'read_only': False,
+ 'required': True,
+ 'type': 'String',
+ },
+ 'id': {
+ 'read_only': True,
+ 'required': False,
+ 'type': 'Integer',
+ },
+ }
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data, expected)