'Tests that if the username in the header changes between requests
that the original user is logged out'

def test_user_switch_forces_new_login(self):

    User.objects.create(username='knownuser')
    response = self.client.get('/remote_user/', **{'REMOTE_USER': self.known_user})
    self.assertEqual(response.context['user'].username, 'knownuser')
    response = self.client.get('/remote_user/', **{'REMOTE_USER': 'newnewuser'})
    self.assertNotEqual(response.context['user'].username, 'knownuser')
