'Authenticates a user via OAuth 2.0, logs out, and verifies the session is logged out.'

def assert_session_logged_out(self, oauth_client, **logout_headers):

    self.authenticate_with_oauth(oauth_client)
    response = self.client.get(reverse('logout'), **logout_headers)
    self.assertEqual(response.status_code, 200)
    self.assertNotIn(AUTHORIZED_CLIENTS_SESSION_KEY, self.client.session)
    return response
