From: Radomir Stevanovic Date: Fri, 10 Aug 2012 15:51:01 +0000 (+0200) Subject: tests: python2.6 compat (`assertIn` added in 2.7) X-Git-Tag: v0.13.7~11^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4da4792844017b7b7e5f78cf106e34a68a08af96;p=services%2Fpython-requests.git tests: python2.6 compat (`assertIn` added in 2.7) --- diff --git a/tests/test_requests_ext.py b/tests/test_requests_ext.py index 883bdce..7645d8c 100644 --- a/tests/test_requests_ext.py +++ b/tests/test_requests_ext.py @@ -110,7 +110,7 @@ class RequestsTestSuite(unittest.TestCase): s = requests.session() s.get(url='http://tinyurl.com/preview.php?disable=1') # we should have set a cookie for tinyurl: preview=0 - self.assertIn('preview', s.cookies) + self.assertTrue('preview' in s.cookies) self.assertEqual(s.cookies['preview'], '0') self.assertEqual(list(s.cookies)[0].name, 'preview') self.assertEqual(list(s.cookies)[0].domain, 'tinyurl.com') @@ -118,13 +118,13 @@ class RequestsTestSuite(unittest.TestCase): # get cookies on another domain r2 = s.get(url='http://httpbin.org/cookies') # the cookie is not there - self.assertNotIn('preview', json.loads(r2.text)['cookies']) + self.assertTrue('preview' not in json.loads(r2.text)['cookies']) # this redirects to another domain, httpbin.org # cookies of the first domain should NOT be sent to the next one r3 = s.get(url='http://tinyurl.com/7zp3jnr') assert r3.url == 'http://httpbin.org/cookies' - self.assertNotIn('preview', json.loads(r2.text)['cookies']) + self.assertTrue('preview' not in json.loads(r2.text)['cookies']) if __name__ == '__main__': unittest.main()