﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
36038	Added a test case for the display_for_field function when a FileField is passed.	Antoliny	Antoliny	"{{{
def display_for_field(value, field, empty_value_display):
    from django.contrib.admin.templatetags.admin_list import _boolean_icon
    ...
    elif isinstance(field, (models.IntegerField, models.FloatField)):
        return formats.number_format(value)
    elif isinstance(field, models.FileField) and value:
        return format_html('<a href=""{}"">{}</a>', value.url, value)
    ...
}}}
There is no test case for the `display_for_field` function when a `FileField` object is passed. --> [https://github.com/django/django/blob/main/tests/admin_utils/tests.py admin_utils test code]

When the `FileField` handling was added in the above function, I found that the test was conducted indirectly through the `FileWidget` readonly attribute. --> [https://github.com/django/django/blob/main/tests/admin_widgets/tests.py#L654 test code]

However, I believe it would be better to have a direct test case for when a `FileField` is passed, considering that `display_for_field` function is globally accessible."	Cleanup/optimization	closed	contrib.admin	dev	Normal	wontfix	display_for_field, FileFIeld		Accepted	1	0	0	1	0	0
