PyCon / pycon2019

Website for PyCon 2019
BSD 3-Clause "New" or "Revised" License
158 stars 89 forks source link

allow receipt image to be a pdf by making it a FileField #550

Closed dchukhin closed 9 years ago

dchukhin commented 9 years ago

Fixes #549. Another thought is whether receipt_image should be renamed to something like receipt_document, since it no longer has to be an image

dpoirier commented 9 years ago

I know it's a pain for file uploads, but can we add a test? When fixing a bug I always prefer to add a test that reproduces the bug, then make the test pass.

dpoirier commented 9 years ago

This is getting there, but the test still passes when the field type is changed back to ImageField, so it's not quite reproducing the original bug.

I confess I'm a little puzzled as to why Django is not failing both uploads in the test when the field is an ImageField, as I thought Django made sure in that case that the uploads were valid image files, and what we're uploading in the test really aren't.