File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 77"""
88from collections import namedtuple
99
10- FieldInfo = namedtuple ('FieldResult ' , [
10+ FieldInfo = namedtuple ('FieldInfo ' , [
1111 'pk' , # Model field instance
1212 'fields' , # Dict of field name -> model field instance
1313 'forward_relations' , # Dict of field name -> RelationInfo
Original file line number Diff line number Diff line change 99from rest_framework .utils import json
1010from rest_framework .utils .breadcrumbs import get_breadcrumbs
1111from rest_framework .utils .formatting import lazy_format
12+ from rest_framework .utils .model_meta import FieldInfo , RelationInfo
1213from rest_framework .utils .urls import remove_query_param , replace_query_param
1314from rest_framework .views import APIView
1415from rest_framework .viewsets import ModelViewSet
@@ -267,3 +268,9 @@ def test_it_formats_lazily(self):
267268 assert message .format .call_count == 1
268269 str (formatted )
269270 assert message .format .call_count == 1
271+
272+
273+ class ModelMetaNamedTupleNames (TestCase ):
274+ def test_named_tuple_names (self ):
275+ assert FieldInfo .__name__ == 'FieldInfo'
276+ assert RelationInfo .__name__ == 'RelationInfo'
You can’t perform that action at this time.
0 commit comments