@@ -1807,6 +1807,24 @@ def testDispatchBadContent(self):
18071807 json_dict = json .loads (b2s (results ))
18081808 self .assertEqual (json_dict ['error' ]['msg' ],
18091809 "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 = {}
18101828
18111829 # Test GET as well. I am not sure if this should pass or not.
18121830 # Arguably GET doesn't use any form/json input but....
@@ -1815,8 +1833,9 @@ def testDispatchBadContent(self):
18151833 form )
18161834 print (results )
18171835 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 = {}
18201839
18211840 def testDispatchBadAccept (self ):
18221841 # simulate: /rest/data/issue expect failure unknown accept settings
0 commit comments