From 3cf66c06f8518173e36cba284970cc53072b51fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20HUBSCHER?= Date: Wed, 15 Jul 2015 18:29:30 +0200 Subject: [PATCH] Use the new cliquet utility for decode_header behavior. --- kinto/tests/test_views_records.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/kinto/tests/test_views_records.py b/kinto/tests/test_views_records.py index 98817f2e..b92bc415 100644 --- a/kinto/tests/test_views_records.py +++ b/kinto/tests/test_views_records.py @@ -1,5 +1,6 @@ import json +from cliquet.utils import decode_header from .support import (BaseWebTest, unittest, MINIMALIST_RECORD, MINIMALIST_GROUP, MINIMALIST_BUCKET, MINIMALIST_COLLECTION) @@ -127,7 +128,7 @@ def test_create_a_record_update_collection_timestamp(self): collection_resp = self.app.get(self.collection_url, headers=self.headers) old_timestamp = int( - json.loads(collection_resp.headers['ETag'].decode('utf-8'))) + decode_header(json.loads(collection_resp.headers['ETag']))) self.app.post_json(self.collection_url, MINIMALIST_RECORD, headers=self.headers, @@ -135,14 +136,14 @@ def test_create_a_record_update_collection_timestamp(self): collection_resp = self.app.get(self.collection_url, headers=self.headers) new_timestamp = int( - json.loads(collection_resp.headers['ETag'].decode('utf-8'))) + decode_header(json.loads(collection_resp.headers['ETag']))) assert old_timestamp < new_timestamp def test_update_a_record_update_collection_timestamp(self): collection_resp = self.app.get(self.collection_url, headers=self.headers) old_timestamp = int( - json.loads(collection_resp.headers['ETag'].decode('utf-8'))) + decode_header(json.loads(collection_resp.headers['ETag']))) self.app.put_json(self.record_url, MINIMALIST_RECORD, headers=self.headers, @@ -150,19 +151,19 @@ def test_update_a_record_update_collection_timestamp(self): collection_resp = self.app.get(self.collection_url, headers=self.headers) new_timestamp = int( - json.loads(collection_resp.headers['ETag'].decode('utf-8'))) + decode_header(json.loads(collection_resp.headers['ETag']))) assert old_timestamp < new_timestamp def test_delete_a_record_update_collection_timestamp(self): collection_resp = self.app.get(self.collection_url, headers=self.headers) old_timestamp = int( - json.loads(collection_resp.headers['ETag'].decode('utf-8'))) + decode_header(json.loads(collection_resp.headers['ETag']))) self.app.delete(self.record_url, headers=self.headers, status=200) collection_resp = self.app.get(self.collection_url, headers=self.headers) new_timestamp = int( - json.loads(collection_resp.headers['ETag'].decode('utf-8'))) + decode_header(json.loads(collection_resp.headers['ETag']))) assert old_timestamp < new_timestamp