File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ Example - With format conversion set to `dasherize`:
122122
123123#### Relationship types
124124
125- A similar option to JSON\_ API\_ FORMAT\_ KEYS can be set for the relationship names:
125+ A similar option to JSON\_ API\_ FORMAT\_ RELATION \ _ KEYS can be set for the relationship names:
126126
127127``` python
128128JSON_API_FORMAT_RELATION_KEYS = ' dasherize'
Original file line number Diff line number Diff line change 1111
1212JSON_API_FORMAT_KEYS = 'camelize'
1313JSON_API_FORMAT_RELATION_KEYS = 'camelize'
14+ JSON_API_PLURALIZE_RELATION_TYPE = True
1415REST_FRAMEWORK .update ({
1516 'PAGINATE_BY' : 1 ,
1617})
Original file line number Diff line number Diff line change 11import pytest
2-
32from django .conf import settings
43from django .contrib .auth import get_user_model
54from rest_framework import serializers
65from rest_framework .response import Response
76from rest_framework .views import APIView
7+
88from rest_framework_json_api import utils
99
1010pytestmark = pytest .mark .django_db
@@ -20,12 +20,12 @@ class Meta():
2020def test_get_resource_name ():
2121 view = ResourceView ()
2222 context = {'view' : view }
23- setattr (settings , 'JSON_API_FORMAT_KEYS ' , None )
23+ setattr (settings , 'JSON_API_FORMAT_RELATION_KEYS ' , None )
2424 assert 'ResourceViews' == utils .get_resource_name (context ), 'not formatted'
2525
2626 view = ResourceView ()
2727 context = {'view' : view }
28- setattr (settings , 'JSON_API_FORMAT_KEYS ' , 'dasherize' )
28+ setattr (settings , 'JSON_API_FORMAT_RELATION_KEYS ' , 'dasherize' )
2929 assert 'resource-views' == utils .get_resource_name (context ), 'derived from view'
3030
3131 view .model = get_user_model ()
You can’t perform that action at this time.
0 commit comments