'Test passed instance is updated with the hash.'

@mock.patch('mkt.webapps.models.Webapp.update')
@mock.patch('mkt.developers.tasks.copy_stored_file')
def test_set_modified(self, mock_move, update_mock):

    expected_suffix = '.opti.png'
    tmp_src = tempfile.NamedTemporaryFile(suffix='.png', delete=False)
    tmp_dest = (os.path.splitext(tmp_src.name)[0] + expected_suffix)
    copy_stored_file(self.img_path, tmp_dest, src_storage=public_storage, dst_storage=local_storage)
    with mock.patch('tempfile.NamedTemporaryFile', (lambda *a, **k: tmp_src)):
        obj = app_factory()
        ret = tasks.pngcrush_image(self.img_path, 'some_hash', set_modified_on=[obj])
    ok_(('some_hash' in ret))
    eq_(update_mock.call_args_list[(-1)][1]['some_hash'], ret['some_hash'])
    ok_(('modified' in update_mock.call_args_list[(-1)][1]))
