def METHOD_NAME(trivial, outpdf, R, owner, user, aes, metadata, err):
    with pytest.raises(Exception, match=err):
        trivial.save(
            outpdf,
            encryption=pikepdf.Encryption(
                R=R, owner=owner, user=user, aes=aes, metadata=metadata
            ),
        )