Model mocking support
|Reported by:||Almad||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Writing unit tests is hard mainly because of how tight are Models coupled to database. Being able to mock Models in a way that one could run tests entirely in memory (giving far better performance then even in-memory sqlite as one must not handle rollbacks and stuff) would be really helpful.
Main problem to solve are foreign keys and contenttype framework handling. Solution could probably be some kind of mocking backend that do not support any database operations except for creation (and providing ID from in-memory generator) and primary-key retrieval (from stored dictionary).