@@ -1807,6 +1807,24 @@ def testDispatchBadContent(self):
1807
1807
json_dict = json .loads (b2s (results ))
1808
1808
self .assertEqual (json_dict ['error' ]['msg' ],
1809
1809
"Unable to process input of type application/jzot" )
1810
+ self .assertNotIn ("Accept-Patch" ,
1811
+ self .server .client .additional_headers )
1812
+ self .server .client .additional_headers = {}
1813
+
1814
+
1815
+ # test with PATCH verb to verify Accept-Patch is correct
1816
+ results = self .server .dispatch ("PATCH" ,
1817
+ "/rest/data/issue" ,
1818
+ form )
1819
+ self .assertEqual (self .server .client .response_code , 415 )
1820
+ json_dict = json .loads (b2s (results ))
1821
+ self .assertEqual (json_dict ['error' ]['msg' ],
1822
+ "Unable to process input of type application/jzot" )
1823
+ self .assertIn ("Accept-Patch" ,
1824
+ self .server .client .additional_headers )
1825
+ self .assertEqual (self .server .client .additional_headers ["Accept-Patch" ],
1826
+ "application/json, application/x-www-form-urlencoded" )
1827
+ self .server .client .additional_headers = {}
1810
1828
1811
1829
# Test GET as well. I am not sure if this should pass or not.
1812
1830
# Arguably GET doesn't use any form/json input but....
@@ -1815,8 +1833,9 @@ def testDispatchBadContent(self):
1815
1833
form )
1816
1834
print (results )
1817
1835
self .assertEqual (self .server .client .response_code , 415 )
1818
-
1819
-
1836
+ self .assertNotIn ("Accept-Patch" ,
1837
+ self .server .client .additional_headers )
1838
+ self .server .client .additional_headers = {}
1820
1839
1821
1840
def testDispatchBadAccept (self ):
1822
1841
# simulate: /rest/data/issue expect failure unknown accept settings
0 commit comments