fix(test): Fixes for "TestClient" changes (FastAPI 0.109 / Starlette)
Seems that client is optional according to the ASGI spec.
https://asgi.readthedocs.io/en/latest/specs/www.html
With Starlette 0.35 the TestClient connection scope is None for client.
https://github.com/encode/starlette/pull/2377
I'm wondering if there is a better way of doing this though.
In theory request.client could be None, but in practice this does not seem to happen (otherwise we'd already run into issues)
So these changes basically just address the changes that were made to Starlette's TestClient.