An integration test checks whether several software units work together and still produce the desired result. Unlike a unit test, which usually targets one function or method, it crosses component boundaries. In a web application, this usually means testing business logic or server behavior rather than clicking through the graphical interface. section 8.1.1
Figure 8.1 Hierarchy of testing categories
Use the testing pyramid to place integration tests between isolated unit tests and slower, broader behavioral or UI tests. section 8.1.1
A Django integration test commonly involves:
- Running several units together instead of isolating a single function. section 8.1.1
- Using Django's test database and ORM support; populate model objects because the test database starts empty. section 8.10
- Writing assertions such as assertEqual() and allowing each test's database transaction to roll back afterward. section 8.10
- Executing tests through Django's test runner, which discovers TestCase classes and methods beginning with test_. section 8.10
Integration tests sit above unit tests because they cover cooperation between components, but below UI tests because they avoid simulating a person operating the interface. That makes them broader than unit tests without requiring the full, slower application stack. section 8.1.1 section 8.10






























