Skip to content

Commit

Permalink
added test for form in kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhegarty committed Apr 12, 2024
1 parent 411543e commit d89a527
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/changelog.rst
Expand Up @@ -8,7 +8,7 @@ Changelog
4.0.0-rc.3 (unreleased)
-----------------------

- fix form not being passed to ``get_import_resource_kwargs()`` (#)
- fix form not being passed to ``get_import_resource_kwargs()`` (#1789)

4.0.0-rc.2 (2024-04-08)
-----------------------
Expand Down
3 changes: 3 additions & 0 deletions tests/core/admin.py
Expand Up @@ -82,6 +82,9 @@ def get_import_resource_kwargs(self, request, **kwargs):
# update resource kwargs so that the Resource is passed the authenticated user
# This is included as an example of how dynamic values
# can be passed to resources
if "form" not in kwargs:
# test for #1789
raise ValueError("'form' param was expected in kwargs")
kwargs = super().get_resource_kwargs(request, **kwargs)
kwargs.update({"user": request.user})
return kwargs
Expand Down

0 comments on commit d89a527

Please sign in to comment.