added test case related to #1711
authordaftshady <daftonshady@gmail.com>
Tue, 29 Oct 2013 16:58:01 +0000 (01:58 +0900)
committerdaftshady <daftonshady@gmail.com>
Tue, 26 Nov 2013 06:22:46 +0000 (15:22 +0900)
test_requests.py

index 3b673956ce7cbb7326f1c79dc53c21e024b819e1..539de7644335a15a3ff7d2561c67ecb6e135ed4c 100755 (executable)
@@ -187,6 +187,14 @@ class RequestsTestCase(unittest.TestCase):
         assert r.json()['cookies']['foo'] == 'bar'
         # Make sure the session cj is still the custom one
         assert s.cookies is cj
+    
+    def test_param_cookiejar_works(self):
+        cj = cookielib.CookieJar()
+        cookiejar_from_dict({'foo' : 'bar'}, cj)
+        s = requests.session()
+        r = s.get(httpbin('cookies'), cookies=cj)
+        # Make sure the cookie was sent
+        assert r.json()['cookies']['foo'] == 'bar'
 
     def test_requests_in_history_are_not_overridden(self):
         resp = requests.get(httpbin('redirect/3'))