Skip to content

Commit

Permalink
Refactor TestResponse to include test for external redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmancuso committed Oct 24, 2024
1 parent 5ba75e6 commit 29f1a49
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/core/response/test_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit 29f1a49

Please sign in to comment.