The aim of the video is to present how to use the Flask test client for testing CRUD operations.
- [Gergo Bogdan] Hi and welcome to the third video…of this section, testing CRUD.…In the previous video we looked at how different…routes can be tested using the Flask Test Client.…In this video, we are going to take a look at how…the Flask Test Client can be used for writing…tests for CRUD operations.…We will review the source code for the tests…and at the end of the video,…we are going to run the tests.…We need to open up the test CRUD file…and let's take a look at the test grid method.…We can use the SURF app objects POST method to…send HTTP POST requests to our API.…
We can use the data parameter to pass in key…values to the POST request.…In this case, we passed in the first name,…last name, email and phone number for a…newly created candidate.…The response object is json and it contains…an ID and a url field.…First we check if both of the fields have values,…then we invoke the my test suite method,…passing the ID from the response.…The my test suite method is almost identical…with the test method we did in the previous video.…
Regardless of platform, you will need to build APIs to serve data between different client applications and endpoints. Good APIs are a necessity for web and mobile projects, especially with the modern, mobile-first approach to development. This course delivers the fundamental knowledge required to enable highly connected interactions between applications via RESTful web APIs. Follow along with Gergo Bogdan and learn how to build up and structure an effective web API that can be used by any client application accessing it over HTTP, using Flask, the Python microframework.
Find out how to implement CRUD operations using SQLAlchemy and MySQL as the data store. Get an understanding of how REST works relative to APIs, and learn how to test APIs written in Python with the support of Flask. Explore token-based authentication and find out how to store passwords securely in your database. Along the way, Gergo introduces best practices and design guidelines when building large applications.
- Setting up Flask
- Using Flask templates and routing
- Implementing CRUD operations
- Implementing pagination
- Configuring RESTful authentication
- HTTP caching
- Securing web APIs
- Testing the application