DEV Community

Cover image for Flask Rest API -Part:6- Testing REST APIs

Flask Rest API -Part:6- Testing REST APIs

Paurakh Sharma Humagain on February 03, 2020

Part 6: Testing REST APIs Howdy! In the previous Part of the series, we learned how to perform password reset in our REST API. In this ...
Collapse
 
bimbimprasetyoafif profile image
Bimo Prasetyo Afif • Edited

Hello, i like your article. Wish you make about implementation flask to microservices with docker or kubernetes :)

btw keep doing, good work

Collapse
 
paurakhsharma profile image
Paurakh Sharma Humagain

Thank you for the suggestion.
Something similar is in the making πŸ˜‰

Collapse
 
bimbimprasetyoafif profile image
Bimo Prasetyo Afif

that's great, can't wait:)

Collapse
 
birkmarcus profile image
Birk Marcus

Thank you for this article. I've enjoyed typing along.
This is a perfect skeleton for an API I'm working on.

Would you say that the authentication and security of this setup is production ready?

Thanks again

Collapse
 
paurakhsharma profile image
Paurakh Sharma Humagain

This article was intended for teaching people how to build Rest API with Flask.

I wouldn't say this is production ready because there are some unhandled exceptions,
that I skipped for the simplicity of the series.

Collapse
 
skow0020 profile image
Colin Skow • Edited

You've got errors in your final versions of your test files:

  1. test_signup.py line 'class SignupTest(unittest.TestCase):' should be 'class SignupTest(BaseCase):'
  2. test_create_movie.py lines """ from tests.BaseCase import BasicTest class TestUserLogin(BasicTest): def test_successful_login(self): """ should be """ from tests.BaseCase import BaseCase class TestUserLogin(BaseCase): def test_create_movie(self): """ ^^^ not very readable but I assume you will figure it out
Collapse
 
paurakhsharma profile image
Paurakh Sharma Humagain

Thank you so much for pointing that out. 😊
I have updated the article to fix it.

Collapse
 
skow0020 profile image
Colin Skow

Welcome!

Collapse
 
bcarter97 profile image
Ben Carter

Do you have any tips on testing with mock JSON files, instead of using the database?

Collapse
 
terrybeardash profile image
TerryBearDash

Thank you for this. Really helpful! How would you go about deploying this?

Collapse
 
paurakhsharma profile image
Paurakh Sharma Humagain

I am glad that this helped you.

Heroku should be an easy way to deploy this.

Collapse
 
henriquepboueri_99 profile image
henriquepboueri

Amazing series. Congratulations.
Is there something about front-end as well?

Collapse
 
iamadou profile image
Ibrahim AMADOU

Thank you for this awesome tutorial series. Thanks again.

Collapse
 
arthurdenner profile image
Arthur Denner

Thank you for this series!

Collapse
 
rahulkamail profile image
rahul

Hi,
How can I add set ENV_FILE_LOCATION = ./.env in docker for this project ?

Collapse
 
bcarter97 profile image
Ben Carter

Hey, thanks for making these tutorials they are great for starting with Flask APIs :)

Collapse
 
reng99 profile image
call me R

I read your series of articles 0-6, They help me a lot. Thank You!