Failing test for Issue #737.
authorCory Benfield <lukasaoz@gmail.com>
Fri, 27 Jul 2012 08:26:04 +0000 (09:26 +0100)
committerCory Benfield <lukasaoz@gmail.com>
Fri, 27 Jul 2012 08:49:39 +0000 (09:49 +0100)
tests/test_requests.py

index 9ddc58b4e2964d1105504cd02719a97f92fa568d..60a840772180db93918871f0e445851645dc8544 100755 (executable)
@@ -962,5 +962,16 @@ class RequestsTestSuite(TestSetup, TestBaseMixin, unittest.TestCase):
         r.content
         r.text
 
+    def test_post_fields_with_multiple_values_and_files(self):
+        """Test that it is possible to POST using the files argument and a
+        list for a value in the data argument."""
+
+        data = {'field': ['a', 'b']}
+        files = {'file': 'Garbled data'}
+        r = post(httpbin('post'), data=data, files=files)
+        t = json.loads(r.text)
+        self.assertEqual(t.get('form'), {'field': 'a, b'})
+        self.assertEqual(t.get('files'), files)
+
 if __name__ == '__main__':
     unittest.main()