Saturday, February 20, 2021

To test the new data checkers UploadChecker and UploadsFolderChecker, I needed to write a test case that uploads some files.

I did not do this using Django test client (which might also be interesting and is explained here) but by extending the demo fixtures: demo_bookings now adds upload entries with dummy pdf files for purchase invoices, and demo3 (in uploads) deletes one of these files (simulating the case where it has actually got lost) and adds an orphaned file to the uploads folder.