3 ms·
Integration tests would be more useful, no?
by collyw 13y ago
Integration tests would be more useful, no?
- rhizome31 13y agoThe more I become experienced with testing, the less I think the difference between functional, integration and unit tests is important. What's important is to have a test suite with good coverage that runs fast. I found that a mix of high level and lower level tests is a good way to achieve this goal and I don't mind mixing them in the same files. High level tests provide coverage more quickly, but some stuff, such as verifying that an exception is handled properly, is easier to test with unit tests.
- dgrant 13y agoHe probably meant integration tests. Generally the standard practice in Django is to do integration testing at various levels. 1) Test the model with an in-memory database, or real database with rollbacks at the end of every test. 2) Test the views, generally using the actual models and db. I don't ever use mocks much when testing a Django project. It wouldn't be too much trouble to mock the model when testing the views, but I don't bother and I don't imagine anyone else does either.