• 
      

    Don't try to create sha256 sums for test attachments without files.

    Review Request #14887 — Created March 7, 2026 and submitted — Latest diff uploaded

    Information

    Review Board
    release-7.1.x

    Reviewers

    TestCase.create_file_attachment has a has_file argument that allows
    creating the attachment without an actual file object (not previously in
    the direct signature, but inherited from create_file_attachment_base).
    Actually using that would cause a crash when attempting to populate the
    sha256 checksum.

    This change explicitly lists that argument in the signature and then
    uses it to guard against trying to populate the sha256.

    Ran unit tests in an extension that used
    create_file_attachment(has_file=False) and saw that it no longer
    failed.

    Commits

    Files