jazzband / django-formtools

A set of high-level abstractions for Django forms
https://django-formtools.readthedocs.io
BSD 3-Clause "New" or "Revised" License
794 stars 135 forks source link

Refs #23 - Initialized preview form with files. #186

Closed claudep closed 3 years ago

claudep commented 3 years ago

Even if file uploads are not supported in preview, we properly initialize forms with both data and files. In certain use cases, custom process_preview() implementations may access uploaded file data.

claudep commented 3 years ago

In fact, there is an issue with form_hmac calculation when we initialize a form with files. I should add a test and a fix.

codecov[bot] commented 3 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@029e6aa). Click here to learn what that means. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #186   +/-   ##
=========================================
  Coverage          ?   93.01%           
=========================================
  Files             ?       11           
  Lines             ?      530           
  Branches          ?       67           
=========================================
  Hits              ?      493           
  Misses            ?       23           
  Partials          ?       14           
Impacted Files Coverage Δ
formtools/preview.py 85.93% <100.00%> (ø)
formtools/utils.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 029e6aa...25bb34e. Read the comment docs.

claudep commented 3 years ago

At last I was able to finish the patch. Hasan, would you mind reviewing it again?