I use django.test.client.Client to check if any text appears when a user logs in. However, I do not seem to support the client account.
This test passes if it is executed manually using Firefox, but not executed with the Client object.
class Test(TestCase): def test_view(self): user.set_password(password) user.save() client = self.client
When I print the answer, it returns a login form that is hidden:
{% if not request.user.is_authenticated %} ... form ... {% endif %}
This is confirmed when running ipython manage.py shell .
The problem is that the Client object does not support an authentication session.
source share