Writing the Test
Learn to write tests in test-driven development.
We'll cover the following
The TDD process consists of the following five steps:
- Write the test.
- Run the test.
- Write the actual code.
- Make all tests pass.
- Refactor and improve the code.
After we install and configure our Django project, we write the test. We need to do this before we start adding any new feature or code the application However, before we can write the test, we must understand the application as a whole. This includes the requirements, project specifications, and what the feature we’re adding is intended to do. We need this so that the unit test we write captures the needed feature.
Get hands-on with 1200+ tech skills courses.