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