aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/tests/generics.py
diff options
context:
space:
mode:
authorÒscar Vilaplana2013-05-19 01:59:19 -0700
committerÒscar Vilaplana2013-05-19 01:59:19 -0700
commit42b61ffcd7dd5091846d884cba34f3a82dcf81f4 (patch)
treeb33a515f024a93051424318b2c6d1a291fee5198 /rest_framework/tests/generics.py
parentfecadacab150aab48b8b84f4f0e5340ead74c287 (diff)
parentc0f3a1c397a564ee78b3a656f14f7ff46b0d2b31 (diff)
downloaddjango-rest-framework-42b61ffcd7dd5091846d884cba34f3a82dcf81f4.tar.bz2
Merge pull request #1 from nschlemm/issue-192-expose-fields-for-options
Merged work in progress for Issue 192 expose fields for options
Diffstat (limited to 'rest_framework/tests/generics.py')
-rw-r--r--rest_framework/tests/generics.py42
1 files changed, 40 insertions, 2 deletions
diff --git a/rest_framework/tests/generics.py b/rest_framework/tests/generics.py
index 15d87e86..a1edd28d 100644
--- a/rest_framework/tests/generics.py
+++ b/rest_framework/tests/generics.py
@@ -121,8 +121,27 @@ class TestRootView(TestCase):
'text/html'
],
'name': 'Root',
- 'description': 'Example description for OPTIONS.'
+ 'description': 'Example description for OPTIONS.',
+ 'actions': {}
}
+ # TODO: this is just a draft for fields' metadata - needs review and decision
+ for method in ('GET', 'POST',):
+ expected['actions'][method] = {
+ 'text': {
+ #'description': '',
+ 'label': None,
+ 'read_only': False,
+ 'required': True,
+ 'type': 'Single Character',
+ },
+ 'id': {
+ #'description': '',
+ 'label': None,
+ 'read_only': True,
+ 'required': False,
+ 'type': 'Integer',
+ },
+ }
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data, expected)
@@ -238,8 +257,27 @@ class TestInstanceView(TestCase):
'text/html'
],
'name': 'Instance',
- 'description': 'Example description for OPTIONS.'
+ 'description': 'Example description for OPTIONS.',
+ 'actions': {}
}
+ # TODO: this is just a draft idea for fields' metadata - needs review and decision
+ for method in ('GET', 'PATCH', 'PUT', 'DELETE'):
+ expected['actions'][method] = {
+ 'text': {
+ #'description': '',
+ 'label': None,
+ 'read_only': False,
+ 'required': True,
+ 'type': 'Single Character',
+ },
+ 'id': {
+ #'description': '',
+ 'label': None,
+ 'read_only': True,
+ 'required': False,
+ 'type': 'Integer',
+ },
+ }
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data, expected)