PyHamcrest fails with the following error

I have this code using pyhamcrest( library:

def check_search(url, voicemail, hidden, field, term):
    response = url.get(search=term)
    assert_that(response.items, has_item(has_entry(field, voicemail[field])))
    assert_that(response.items, is_not(has_item(has_entry(field, hidden[field]))))

    response = url.get(**{field: voicemail[field]})
    assert_that(response.items, has_item(has_entry('id', voicemail['id'])))
    assert_that(response.items, is_not(has_item(has_entry('id', hidden['id']))))

When I run the tests, I get the following error:

2022-01-12 03:03:06.113981 | vm-debian-10-m1s |     assert_that(response.items, is_not(has_item(has_entry('id', hidden['id']))))
2022-01-12 03:03:06.113995 | vm-debian-10-m1s | AssertionError:
2022-01-12 03:03:06.114009 | vm-debian-10-m1s | Expected: not a sequence containing a dictionary containing ['id': <24>]
2022-01-12 03:03:06.114025 | vm-debian-10-m1s |      but: but was <[{'id': 22, 'tenant_uuid': 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeee1', 'number': '123456789123456789', 'firstname': None, 'lastname': None, 'password': None, 'language': None, 'preprocess_subroutine': None, 'description': None, 'links': [{'rel': 'agents', 'href': ''}], 'queues': [], 'skills': [], 'users': []}, {'id': 24, 'tenant_uuid': 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeee1', 'number': '2310', 'firstname': 'hidden', 'lastname': 'hidden', 'password': None, 'language': None, 'preprocess_subroutine': 'hidden', 'description': None, 'links': [{'rel': 'agents', 'href': ''}], 'queues': [], 'skills': [], 'users': []}, {'id': 25, 'tenant_uuid': 'eeeeeeee-eeee-eeee-eeee-eeeeeeeeeee1', 'number': '0319', 'firstname': 'search', 'lastname': 'search', 'password': None, 'language': None, 'preprocess_subroutine': 'search', 'description': None, 'links': [{'rel': 'agents', 'href': ''}], 'queues': [], 'skills': [], 'users': []}]>

Anyone knows how to fix it? Thanks.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum