'Test whether non string objects are filtered out.
Put non string objects into the environment, inject
correct assertion and try to get an unscoped token.
Expect server not to fail on using split() method on
non string objects and return token id in the HTTP header.'

def test_issue_unscoped_token_malformed_environment(self):

    api = auth_controllers.Auth()
    environ = {'malformed_object': object(), 'another_bad_idea': tuple(range(10)), 'yet_another_bad_param': dict(zip(uuid.uuid4().hex, range(32)))}
    environ.update(mapping_fixtures.EMPLOYEE_ASSERTION)
    request = self.make_request(environ=environ)
    r = api.authenticate_for_token(request, self.UNSCOPED_V3_SAML2_REQ)
    self.assertIsNotNone(r.headers.get('X-Subject-Token'))
