Skip to content

Commit 7125b4f

Browse files
committed
make sure validate field is present
1 parent e0c2c29 commit 7125b4f

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎stream/tests.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,21 @@ def getfeed(feed_slug, user_id):
6161
return client.feed(feed_slug, user_id + get_unique_postfix())
6262

6363

64+
def api_request_parse_validator(test):
65+
def wrapper(meth):
66+
def _parse_response(*args, **kwargs):
67+
response = meth(*args, **kwargs)
68+
test.assertIn('duration', response)
69+
return response
70+
return _parse_response
71+
return wrapper
72+
73+
6474
class ClientTest(TestCase):
6575

6676
def setUp(self):
77+
client._parse_response = api_request_parse_validator(self)(client._parse_response)
78+
6779
# DEBUG account details
6880
user1 = getfeed('user', '1')
6981
user2 = getfeed('user', '2')

0 commit comments

Comments
 (0)