Here are the examples of the python api twisted.web.http.NOT_ACCEPTABLE taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
3
Example 1
Project: txyoga Source File: test_badrequest.py
def test_badAcceptHeader(self):
"""
Providing a bogus Accept header when requesting a page results in an
error.
"""
headers = http_headers.Headers()
headers.setRawHeaders("Accept", ["text/bogus"])
return self._test_badCollectionRequest(None, headers, http.NOT_ACCEPTABLE)
3
Example 2
Project: txyoga Source File: test_badrequest.py
def test_getElement_bogusAcceptHeader(self):
"""
Requesting an element with a bogus Accept header results in a response
that the resquest was not acceptable.
"""
headers = http_headers.Headers()
headers.setRawHeaders("Accept", ["text/bogus"])
name, _, _ = self.elementArgs[0]
return self._test_badElementRequest(name, None, headers, http.NOT_ACCEPTABLE)