Exemple #1
0
 def assert_see_other__keep_query_string(self) -> None:
     response = FakeResponse(
         "303 See Other",
         [("Location", "http://example.com/foo?abc=def#frag")],
     )
     with assert_succeeds(AssertionError):
         response.assert_see_other("/foo?abc=def#frag")
Exemple #2
0
 def assert_see_other__relative_location(self) -> None:
     response = FakeResponse(
         "303 See Other", [("Location", "http://example.com/foo/bar")]
     )
     with assert_succeeds(AssertionError):
         response.assert_see_other("/foo/bar")
Exemple #3
0
 def assert_see_other__no_location_header(self) -> None:
     response = FakeResponse("303 See Other", [])
     with assert_raises(AssertionError):
         response.assert_see_other("http://example.org/")
Exemple #4
0
 def assert_see_other__wrong_location(self) -> None:
     response = FakeResponse(
         "303 See Other", [("Location", "http://example.com/")]
     )
     with assert_raises(AssertionError):
         response.assert_see_other("http://example.org/")
Exemple #5
0
 def assert_see_other__wrong_status(self) -> None:
     response = FakeResponse(
         "200 OK", [("Location", "http://example.com/")]
     )
     with assert_raises(AssertionError):
         response.assert_see_other("http://example.com/")