Skip to content

Commit

Permalink
'clientIp' can no longer be set with TestClient
Browse files Browse the repository at this point in the history
The 'client' scope was removed in
encode/starlette#2377, which means we can't read
the client IP from it in unit tests
  • Loading branch information
imjoehaines committed Jan 24, 2024
1 parent b22ab1f commit c799799
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion tests/integrations/test_asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ async def app(scope, recv, send):
self.assertEqual('GET', request['httpMethod'])
self.assertEqual('http', request['type'])
self.assertEqual('http://testserver/', request['url'])
self.assertEqual('testclient', request['clientIp'])
self.assertEqual('testclient', request['headers']['user-agent'])

exception = payload['events'][0]['exceptions'][0]
Expand Down
1 change: 0 additions & 1 deletion tests/integrations/test_async_asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ async def app(scope, recv, send):
self.assertEqual('GET', request['httpMethod'])
self.assertEqual('http', request['type'])
self.assertEqual('http://testserver/', request['url'])
self.assertEqual('testclient', request['clientIp'])
self.assertEqual('testclient', request['headers']['user-agent'])
assert 'environment' not in payload['events'][0]['metaData']

Expand Down

0 comments on commit c799799

Please sign in to comment.