The software is almost three years old and has the standard tests that came with Django but we’d like to start unit testing everything and backfilling tests as we go. This seems like a daunting task mainly because of the database requirements. Ideally we can use a copy of the database to test against but Django requires you to use fixtures which means we’d have to export it all and import it for every “build” which alone takes a very long time. Is there a more elegant way to approach this?
Share
I wouldn’t unit test everything, just the critical bits that have to be right no matter what. Working Effectively with Legacy Code is a great book that discusses several ways to go about this. I’ve found it very useful when adding unit tests to old code.