Write and Run the Tests for the Templates
Explore how to write and run tests to verify Django templates, focusing on the homepage template. Learn to use assertions to confirm correct template usage and content presence, and understand how to run tests to guide your development process.
We'll cover the following...
As we know, Django follows the Model-View-Template model. For our models, we’ve written both the test and the code. We discussed the view and also the template. However, we haven’t yet created a complete test suite for the template. This is what this particular lesson will focus on.
Note: It’s an iterative process to program an application. We go to the next piece of functionality as one is programmed out.
This project’s template is only a single file called index.html that was prepared in the previous session. This is where the ...