for i, _ in self._find(table, self._format_filter(filter)):
id_list.append(i)
deleted = len(id_list)
- for i in id_list:
+ for i in reversed(id_list):
del self.db[table][i]
return {"deleted": deleted}
except DbException:
assert excinfo.value.http_code == http.HTTPStatus.NOT_FOUND
@pytest.mark.parametrize("table, filter, expected_data", [
-# ("test", {}, []),
+ ("test", {}, []),
("test", {"_id": 1}, [{"_id": 2, "data": 2}, {"_id": 3, "data": 3}]),
("test", {"_id": 2}, [{"_id": 1, "data": 1}, {"_id": 3, "data": 3}]),
("test", {"_id": 1, "data": 1}, [{"_id": 2, "data": 2}, {"_id": 3, "data": 3}]),