Few tests are failing when ran against the latest mongoengine (0.10.5). After some debugging, it looks like it breaks some mongoengine internals when it uses type(...) to instantiate the modified class.
This makes the Document.id field not in line with the object's pk after a .save(). I tried to fix it but ended up re-writing the state machine using a metaclass and it now works wonderfully. Let me know in case you are interested in a PR.
Few tests are failing when ran against the latest mongoengine (0.10.5). After some debugging, it looks like it breaks some mongoengine internals when it uses type(...) to instantiate the modified class.
This makes the Document.id field not in line with the object's pk after a .save(). I tried to fix it but ended up re-writing the state machine using a metaclass and it now works wonderfully. Let me know in case you are interested in a PR.