From 29f1a498907626094e9faf9dd083727c6afb5992 Mon Sep 17 00:00:00 2001 From: Joe Mancuso Date: Thu, 24 Oct 2024 14:11:50 -0400 Subject: [PATCH] Refactor TestResponse to include test for external redirects --- tests/core/response/test_response.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/core/response/test_response.py b/tests/core/response/test_response.py index 7492694f8..286ef745c 100644 --- a/tests/core/response/test_response.py +++ b/tests/core/response/test_response.py @@ -15,3 +15,9 @@ def test_encoding_chinese_characters(self): response = Response(self.application) content = response.json({"test": "我"}) self.assertEqual(content.decode("utf-8"), '{"test": "我"}') + + def test_redirect_external(self): + response = Response(self.application) + response = response.redirect("https://google.com") + self.assertEqual(response._status, "302 Found") + self.assertEqual(response.header_bag.get("Location").value, "https://google.com")