Skip to content

django from_form does not work with filefields #4093

Open
@arjoonn-s

Description

@arjoonn-s

The from_form function does not bind files correctly.

From the source available I think it should be supplying file fields separately. Currently it is running:

    return _forms_impl(
        st.builds(
            partial(form, **form_kwargs),  # type: ignore
            data=st.fixed_dictionaries(field_strategies),  # type: ignore
        )
    )

I think it should have been something like:

    return _forms_impl(
        st.builds(
            partial(form, **form_kwargs),  # type: ignore
            data=st.fixed_dictionaries(field_strategies),  # type: ignore
            files=st.fixed_dictionaries(field_strategies),  # type: ignore
        )
    )

cc @sethuvishal


Is this expected? If not I think we're happy to submit a patch for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    interophow to play nicely with other packages

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions