Improve connect/disconnect

- document disconnect + sample of usage
- add more test cases to prevent github issues regressions
This commit is contained in:
Bastien Gérard
2019-04-24 22:44:07 +02:00
parent d1467c2f73
commit b1e28d02f7
5 changed files with 95 additions and 22 deletions

View File

@@ -5,7 +5,7 @@ Changelog
Development
===========
- expose `mongoengine.connection.disconnect` and `mongoengine.connection.disconnect_all`
- POTENTIAL BREAKING CHANGE: Fixes in connect/disconnect methods
- POTENTIAL BREAKING CHANGE: Fixes in connect/disconnect methods #565 #566
- calling `connect` 2 times with the same alias and different parameter will raise an error (should call disconnect first)
- disconnect now clears `mongoengine.connection._connection_settings`
- disconnect now clears the cached attribute `Document._collection`