'Prevent logging in with someone else\'s credentials.
It\'s very easy to forget to limit the credentials query by user.
Let\'s just test it for a sanity check.'

def test_with_multiple_users_and_invalid_credentials(self):

    self._make_credentials('totp', count=3)
    new_user = unit.create_user(self.identity_api, domain_id=self.domain_id)
    self.assignment_api.create_grant(self.role['id'], user_id=new_user['id'], project_id=self.project['id'])
    user2_creds = self._make_credentials('totp', count=1, user_id=new_user['id'])
    user_id = self.default_domain_user['id']
    secret = user2_creds[(-1)]['blob']
    auth_data = self._make_auth_data_by_id(totp._generate_totp_passcode(secret), user_id=user_id)
    self.v3_create_token(auth_data, expected_status=http_client.UNAUTHORIZED)
