'Request a logout after logging in'

def test_logout(self):

    self.client.login(username=u'testclient', password=u'password')
    response = self.client.get(u'/test_client/login_protected_view/')
    self.assertEqual(response.status_code, 200)
    self.assertEqual(response.context[u'user'].username, u'testclient')
    self.client.logout()
    response = self.client.get(u'/test_client/login_protected_view/')
    self.assertRedirects(response, u'http://testserver/accounts/login/?next=/test_client/login_protected_view/')
