def get_related_field_name(self): field_name = self.kwargs["related_field"] field_name = undo_format_link_segment(field_name) if field_name in self.field_name_mapping: return self.field_name_mapping[field_name] return field_name
def test_undo_format_link_segment(settings, format_links, output): settings.JSON_API_FORMAT_RELATED_LINKS = format_links link_segment = "fullName" assert undo_format_link_segment(link_segment) == output
def get_related_field_name(self): field_name = self.kwargs["related_field"] return undo_format_link_segment(field_name)