The aim of this video is to present how an authentication layer of our Flask application can be tested using Flask Test Client.
- View Offline
- [Instructor] Hi, and welcome…to the last video of this section,…Testing Authentication.…In the last video, we reviewed how cloud operations…can be tested using the Flask test client.…In this video, we are going to take a look at…how to use the Flask test client…and we are going to review the source code for the test.…In the end, we would run the test,…and we will show how to use this…with the authentication mechanisms.…If we open up the test_auth.t5 file,…we can see that the testing of the authorization…is very similar to the test we have written before.…
All we need to do is to press in the correct header values.…In our case that is authorization header…and we have to specify the value for this.…Since we are using basic HTTP authorization,…we have to write the basic as a string in the header first.…Then comes the user password pair in base 64 encoding.…This is a normal Get request to the about page.…The response the data will hold the HTML code,…which was returned by Flask.…Then we have two accessions,…plus we need to test if the response code of the request…
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