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?

Thanks!

Question asked in stackoverflow 
<https://stackoverflow.com/questions/48720028/cannot-redirect-when-django-model-class-is-mocked>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7d000795-267e-4452-a6e3-d9a636d06cb6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to