title: How to properly test an app with REST API + Flask JWT extended?
body: <p>Assuming that I have an API endpoint, whose resources are accessible to authorised users only who possess a valid access token, similar with this: </p>
  
  <pre class="lang-py prettyprint-override"><code>from flask_restful import Resource
  from flask_jwt_extended import jwt_required
  
  class Collection(Resource):
  
      @jwt_required
      def get(self):
          """
          GET response implementation here.
          """
          # Queries and logic here
          data = 10
          if(is_everythig_ok()):
              return {"data": data}, 200
          else:
              return {"message":"Failed to get data."}, 400
  
  </code></pre>
  
  <p>And assuming that there is a LoginUser endpoint which returns a valid access_token, how can I write some unit tests to reproduce the two status codes (200 for success and 400 for failure) while user HAS a valid access token AND also the case when the user DOES NOT have a valid access_token. </p>
  
  <p>I have test my endpoints with POSTMAN and it seems ok, but I also need to write some unit tests for proof. So, what is the proper way of doing that?</p>