def test_with_state(self):
    resp = self.client.get('/auth/login/?orig_url=nowhere')
    parsed_location = urlparse(resp.headers['Location'])
    query_params = parse_qs(parsed_location.query)
    assert ('state' in query_params)
    assert (urlsafe_b64decode(query_params['state'][0]) == 'nowhere')
def test_with_state(self):
    resp = self.client.get('/auth/login/?orig_url=nowhere')
    parsed_location = urlparse(resp.headers['Location'])
    query_params = parse_qs(parsed_location.query)
    assert ('state' in query_params)
    assert (urlsafe_b64decode(query_params['state'][0]) == 'nowhere')