@pytest.mark.django_db
def test_image_plugin_choice_widget_get_object():
 image = File.objects.create()
 widget = ImagePluginChoiceWidget()
 assert (widget.get_object(image.pk) == image)
 assert (widget.get_object(1000) == None)

@ pytest . mark . django_db def test_image_plugin_choice_widget_get_object ( ) : image = File . objects . create ( ) widget = ImagePluginChoiceWidget ( ) assert ( widget . get_object ( image . pk ) == image ) assert ( widget . get_object ( 1000 ) == None )
test get_object method for imagepluginchoicewidget .