def METHOD_NAME(self, client):
    with pytest.raises(HttpResponseError) as e:
        client.begin_recognize_invoices_from_url(self.invoice_url_pdf, locale="not a locale")
    assert "locale" in e.value.error.message