I have a view that sets a cookie using response.set_cookie
method. I would like to test if the cookie is being set in a TestCase
.
According to docs, the cookie should be accessible in the client object, but client.cookies.items
returns an empty list. The cookie is being correctly set in the browser.
Any ideas?
EDIT: adding test case
>>> response = self.client.get(url)
>>> self.client.cookies.items()
[]
The last statement returns an empty list.