python3: decode HttpResponse content (#40012)

This commit is contained in:
Nicolas Roche 2020-02-20 14:06:50 +01:00
parent 53b81ec6ab
commit cf72237413
1 changed files with 2 additions and 2 deletions

View File

@ -7,10 +7,10 @@ def test_xforwardedfor(settings, tenants, client):
settings.ALLOWED_HOSTS.append(tenant.domain_url)
response = client.get('/', SERVER_NAME=tenant.domain_url,
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()
settings.USE_X_FORWARDED_FOR = False
for tenant in tenants:
response = client.get('/', SERVER_NAME=tenant.domain_url,
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()