redirect() doesn't work with a mock object in version 2
42 views
Skip to first unread message
S.j. Sakib
unread,
Feb 11, 2018, 8:41:25 AM2/11/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Hello, When I try to call the django.shortcuts.redirect function with a Mock() object from unittest.mock, it results in error. I've found that, the problem happens in iri_to_uri function in django.utils.encoding. It used to use force_bytes in earlier versions of django. Any idea how to use a mock object with the redirect object?