Closed chenjr0719 closed 1 year ago
Hey. I looked into the issue and found out that only two of mongomock's methods raise DuplicateKeyError – _insert
and _ensure_uniques
. So I've created MR (https://github.com/michaelkryukov/mongomock_motor/pull/32) where I patch _insert
and _ensure_uniques
(with tests from this MR). If it works for you, I can close this one and merge #32
Hi there, thanks for creating this fantastic package. It saves my life to test with
motor
.In my use case, I also need the error details of
DuplicateKeyError
when usingreplace_one()
. So I made this PR to fit my requirement. I think someone else might need this feature as well. Please let me know if the test cases or implementation should be modified. 👍