def test_view_failed_delitem(attr):
    adata = gen_adata((10, 10))
    view = adata[5:7, :][:, :5]
    adata_hash = joblib.hash(adata)
    view_hash = joblib.hash(view)

    with pytest.raises(KeyError):
        getattr(view, attr).__delitem__("not a key")

    assert view.is_view
    assert adata_hash == joblib.hash(adata)
    assert view_hash == joblib.hash(view)
def test_validation_for_handled_application_with_invalid_final_review(self):
        self.assertEqual(
            self.voiceover_application.status,
            suggestion_models.STATUS_IN_REVIEW)
        self.assertEqual(self.voiceover_application.final_reviewer_id, None)
        self.voiceover_application.validate()

        self.voiceover_application.status = suggestion_models.STATUS_ACCEPTED
        with self.assertRaisesRegex(
            utils.ValidationError, 'Expected final_reviewer_id to be a string'
        ):
            self.voiceover_application.validate()