Skip to content

Commit

Permalink
improve support for old Django versions in threat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe-papazian committed May 2, 2024
1 parent fc4f9be commit 3740139
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/appsec/contrib_appsec/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,13 +695,13 @@ def test_request_suspicious_request_block_match_response_headers(
)
assert self.headers(response)["content-type"] == "text/json"
for k in headers:
assert k not in response.headers
assert k not in self.headers(response)
else:
assert self.status(response) == 200
assert get_tag(http.STATUS_CODE) == "200"
assert get_triggers(root_span()) is None
assert "content-length" in response.headers
assert int(response.headers["content-length"]) == len(self.body(response).encode())
assert "content-length" in self.headers(response)
assert int(self.headers(response)["content-length"]) == len(self.body(response).encode())

LARGE_BODY = {
f"key_{i}": {f"key_{i}_{j}": {f"key_{i}_{j}_{k}": f"value_{i}_{j}_{k}" for k in range(4)} for j in range(4)}
Expand Down

0 comments on commit 3740139

Please sign in to comment.