()
| 98 | |
| 99 | |
| 100 | def test_unauthorized_www_authenticate(): |
| 101 | basic = WWWAuthenticate("basic", {"realm": "test"}) |
| 102 | digest = WWWAuthenticate("digest", {"realm": "test", "nonce": "test"}) |
| 103 | |
| 104 | exc = exceptions.Unauthorized(www_authenticate=basic) |
| 105 | h = Headers(exc.get_headers({})) |
| 106 | assert h["WWW-Authenticate"] == str(basic) |
| 107 | |
| 108 | exc = exceptions.Unauthorized(www_authenticate=[digest, basic]) |
| 109 | h = Headers(exc.get_headers({})) |
| 110 | assert h.get_all("WWW-Authenticate") == [str(digest), str(basic)] |
| 111 | |
| 112 | exc = exceptions.Unauthorized() |
| 113 | h = Headers(exc.get_headers({})) |
| 114 | assert "WWW-Authenticate" not in h |
| 115 | |
| 116 | |
| 117 | def test_response_header_content_type_should_contain_charset(): |
nothing calls this directly
no test coverage detected