Your first post request to the home url uses the dummy client, which you have logged in.
Your request to the /saved
url uses self.browser
, which is not logged in.
It is not clear why you are using both self.client
and self.browser
in the same test. If you don't need to use the live server in this test, then I would use self.client
throughout. For the example you've shown, you could do:
response = self.client.get('/saved')
self.assertContains(response, TestCase3.title)
If you do need to use the live server, see the live server test case docs for an example of logging in using the selenium client.