Building Data-Driven Web Apps with Flask and SQLAlchemy Transcripts
Chapter: Course conclusion
Lecture: Testing web apps
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
Three different types of tests that we might write for our web applications. Testing the view model, as we just talked about.
0:08
Calling those view methods. Which presumably are using a few models but not all of them, I guess. But testing what does it actually look like
0:16
if we call the entire method and what kind of response do we get back there? Or almost an integration test where we fire up a test fake web server
0:26
as running our application it's done all of the initialization. We give it a URL and then it goes through all the routing infrastructure
0:32
and everything that Flask does actually go and find the right location and then run the method which probably works
0:39
for some kind of view model. These are the three. We have even higher level test we could write Like automated tests against a server
0:45
like with Selenium or other types of smaller unit test but these are the three we focus on. Specifically to address testing web apps.
0:54
We also talked about the Pareto principal or the 80/20 rule with testing by just calling every URL in the site map. That works pretty well actually.