Skip to content

Commit c88a1f8

Browse files
Add failing test for resource name consistency
When setting `resource_name = None`, the related instance's resource name is used in `relationships`, but `None` is used in `included`. This is related to #94 and #124
1 parent bb26764 commit c88a1f8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

example/tests/integration/test_model_resource_name.py

+5
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ def test_type_match_on_included_and_inline_with_serializer_resource_name(self, c
103103

104104
_check_relationship_and_included_comment_type_are_the_same(client, reverse("entry-list"))
105105

106+
def test_type_match_on_included_and_inline_with_serializer_resource_name2(self, client):
107+
serializers.CommentSerializer.Meta.resource_name = None
108+
109+
_check_relationship_and_included_comment_type_are_the_same(client, reverse("entry-list"))
110+
106111
def test_type_match_on_included_and_inline_with_serializer_resource_name_and_JSONAPIMeta(self, client):
107112
models.Comment.__bases__ += (_PatchedModel,)
108113
serializers.CommentSerializer.Meta.resource_name = "resource_name_from_serializer"

0 commit comments

Comments
 (0)