python3: decode HttpResponse content (#40012)
This commit is contained in:
parent
53b81ec6ab
commit
cf72237413
|
@ -7,10 +7,10 @@ def test_xforwardedfor(settings, tenants, client):
|
||||||
settings.ALLOWED_HOSTS.append(tenant.domain_url)
|
settings.ALLOWED_HOSTS.append(tenant.domain_url)
|
||||||
response = client.get('/', SERVER_NAME=tenant.domain_url,
|
response = client.get('/', SERVER_NAME=tenant.domain_url,
|
||||||
HTTP_X_FORWARDED_FOR='99.99.99.99, 127.0.0.1')
|
HTTP_X_FORWARDED_FOR='99.99.99.99, 127.0.0.1')
|
||||||
assert '99.99.99.99' in response.content
|
assert '99.99.99.99' in response.content.decode()
|
||||||
connection.set_schema_to_public()
|
connection.set_schema_to_public()
|
||||||
settings.USE_X_FORWARDED_FOR = False
|
settings.USE_X_FORWARDED_FOR = False
|
||||||
for tenant in tenants:
|
for tenant in tenants:
|
||||||
response = client.get('/', SERVER_NAME=tenant.domain_url,
|
response = client.get('/', SERVER_NAME=tenant.domain_url,
|
||||||
HTTP_X_FORWARDED_FOR='99.99.99.99, 127.0.0.1')
|
HTTP_X_FORWARDED_FOR='99.99.99.99, 127.0.0.1')
|
||||||
assert not '99.99.99.99' in response.content
|
assert not '99.99.99.99' in response.content.decode()
|
||||||
|
|
Loading…
Reference in New Issue