Testing update collection (section 5)

I’m facing an issue while testing to update a collection. Below is my code:

def update_collection(api_client):
    def do_update_collection(collection):
        return api_client.put(f'/store/collections/{collection.id}/', collection)
    return do_update_collection

class TestUpdateCollection:
    def test_if_user_is_anonymous_returns_401(self, update_collection):
        collection = baker.make(Collection)
        collection.title = 'new_title'
        response = update_collection(collection)
        assert response.status_code == status.HTTP_401_UNAUTHORIZED

But I’m getting the following error while running the test:

E AttributeError: ‘Collection’ object has no attribute ‘items’

Why does it expect the collection object to contain ‘items’?

Thanks in advance for your help!