79117366

Date: 2024-10-23 09:50:18
Score: 0.5
Natty:
Report link

The old file is being deleted from a different directory than where the test is running. To fix it:

old_file_path = Path(sample.test_suite.path)
if old_file_path.exists():
    old_file_path.unlink()
new_file_path = Path(sample.test_suite.path)

This should fix the issue because:

It uses the actual paths from Django's model instead of constructing them It properly cleans up the old file using the correct path.

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: AssertionError