Re:ORMs Are Backwards
by Scarblac on Wednesday September 04, 2019 @04:38AM
(#20875174)
Can you write the tests so that you create object instances and not save them to a database at all? You don't need to test the ORM and database, after all, just your code.
[ Parent
| on HN ]
The closer you keep things to production, the more likely you are to catch errors that will occur on production.
unit tests, yeah, but if you try to get "the most bang for the buck" in like "test a lot with zero/little effort" you'll end up with a layer of "integration tests": that (1) set stuff in db, (2) do stuff, (3) read stuff from db and assert its correctness... A sane ORM would not actively hinder this scenario even cross-dbs or with memory-mocked-dbs, but Django's does!