Skip to content

Commit

Permalink
Merge pull request #831 from MasoniteFramework/fix/714-1
Browse files Browse the repository at this point in the history
Refactor TestResponse to include test for external redirects
  • Loading branch information
josephmancuso authored Oct 24, 2024
2 parents 5ba75e6 + 29f1a49 commit 25693bc
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 25693bc

Please sign in to comment.