According to the docs:
A TestCase, on the other hand, does not truncate tables and reload initial data at the beginning of a test. Instead, it encloses
For the purposes of the database, tearDown
is pretty pointless, because each test is run in a transaction. However, not everything in a test involves the database. You might test file creation/reading, spin off processes, open network connections, etc. These types of things usually require you to "close" them after you're done. This is what tearDown
is for, i.e. cleaning up stuff from your setUp
method, not related to the database. (Though, if you were actually directly connecting to a database, i.e. as the actual Django tests must do to make sure all the DBAPI stuff works properly, you'd need to do clean up there too.)