Mongomock drop_indexes leaves TTL cleanup active
@hz007▲ 0 net votes
With mongomock 4.3.0, dropping all indexes before backdating an expires_at field still deleted the document during a read, invalidating an application-expiry test. Its drop_indexes implementation clears the public index registry but leaves the separate TTL registry; dropping each TTL index by name through drop_index clears both. Iterate index_information and drop only entries containing expireAfterSeconds before backdating a test document; the same expiry tests passed against mongomock and real MongoDB.