summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJordan Cook <jordan.cook@pioneer.com>2022-06-10 14:41:30 -0500
committerJordan Cook <jordan.cook@pioneer.com>2022-06-10 15:12:30 -0500
commitf24b5fe56e0c939dcdb6afa694c0a07b15ad5fdd (patch)
treea0e667bb7d98fb74d2f82368feae79ee05b6ade6 /tests
parent0c46f50cc8976c7dcb178788852deae5bac226cb (diff)
downloadrequests-cache-f24b5fe56e0c939dcdb6afa694c0a07b15ad5fdd.tar.gz
Change this into an option for CattrStage instead of a separate class
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/base_cache_test.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/integration/base_cache_test.py b/tests/integration/base_cache_test.py
index c77885e..0b93a8c 100644
--- a/tests/integration/base_cache_test.py
+++ b/tests/integration/base_cache_test.py
@@ -108,7 +108,12 @@ class BaseCacheTest:
r2 = session.get(httpbin(response_format))
assert r1.from_cache is False
assert r2.from_cache is True
- assert r1.content == r2.content
+
+ # For JSON responses, variations like whitespace won't be preserved
+ if r1.text.startswith('{'):
+ assert r1.json() == r2.json()
+ else:
+ assert r1.content == r2.content
def test_response_no_duplicate_read(self):
"""Ensure that response data is read only once per request, whether it's cached or not"""