As I was working on issue #126 I found some bugs in the file upload.
First thing is that when no file is attached and "Mark this list as still in progress" is selected the 'tmp' folder is moved. This is because the only checks are if the test is a file-upload and if it is skipped or not. There should also be checked if a file is uploaded. The following code works: perform.py line 509
for delta, ti_form in enumerate(formset): if ti_form.unit_test_info.test.is_upload() and not ti_form.cleaned_data["skipped"] and \ len(ti_form.cleaned_data["string_value"]) > 0: fname = ti_form.cleaned_data["string_value"] src = os.path.join(settings.TMP_UPLOAD_ROOT, fname) d = os.path.join(settings.UPLOAD_ROOT, "%s" % self.object.pk) if not os.path.exists(d): os.mkdir(d) dest = os.path.join(settings.UPLOAD_ROOT, d, fname) shutil.move(src, dest)
The second problem is that if a TestList is marked as in progress and a file is attached when it is resumed the file doesn't get moved from the tmp folder. To me it seems that the code to do that is missing from EditTestListInstance. But I'm not sure how to fix it.