def METHOD_NAME(self):
    payload = {
        "error_list": [
            {"code": "custom-error", "message": "great message"}
        ]
    }
    responses.add(
        responses.PATCH,
        "https://dashboard.snapcraft.io/dev/api/account",
        json=payload,
        status=400,
    )
    authorization = self._log_in(self.client)
    response = self.client.post(
        "/account/username", data={"username": "toto"}
    )
    self.assertEqual(1, len(responses.calls))
    called = responses.calls[0]
    self.assertEqual(
        "https://dashboard.snapcraft.io/dev/api/account",
        called.request.url,
    )
    self.assertEqual(
        authorization, called.request.headers.get("Authorization")
    )
    self.assertEqual(b'{"short_namespace": "toto"}', called.request.body)
    assert response.status_code == 200
    self.assert_template_used("publisher/username.html")
    self.assert_context("username", "toto")
    self.assert_context("error_list", payload["error_list"])