class_docstr: Calls to :meth:`orion.core.io.database.AbstractDB.remove`.
docstr: Verify that indexes are properly update after deletion.
docstr_tok: ["Verify","that","indexes","are","properly","update","after","deletion","."]
code: def test_remove_update_indexes(self, orion_db, test_collection):
      """Verify that indexes are properly update after deletion."""
      with pytest.raises(DuplicateKeyError):
          orion_db.write(
              "test_collection", {"_id": test_collection[0]["_id"]}
          )
      with pytest.raises(DuplicateKeyError):
          orion_db.write(
              "test_collection", {"_id": test_collection[1]["_id"]}
          )
  
      filt = {"_id": test_collection[0]["_id"]}
  
      count_before = orion_db.count("test_collection")
      # call interface
      assert orion_db.remove("test_collection", filt) == 1
      assert orion_db.count("test_collection") == count_before - 1
      # Should not fail now, otherwise it means the indexes were not updated properly during
      # remove()
      orion_db.write("test_collection", filt)
      # And this should still fail
      with pytest.raises(DuplicateKeyError):
          orion_db.write(
              "test_collection", {"_id": test_collection[1]["_id"]}
          )
  
imports: import pickle
  from datetime import datetime
  import pytest
  from orion.core.io.database import Database, DatabaseError, DuplicateKeyError
  from orion.core.io.database.ephemeraldb import EphemeralDB
  from orion.core.io.database.mongodb import MongoDB
  from orion.core.io.database.pickleddb import PickledDB
  from .conftest import insert_test_collection
label_desc: Use image node_id 3 for calling the TestRemove obj's underlying member method code with example usage: obj.test_remove_update_indexes(orion_db, test_collection) without return types