title: Unittest a route that returns a json gives this error: "TypeError: decoding str is not supported"
body: <p>I have a route that returns a json.
  I am testing this route to check if the returned json equals my expected json.
  When i test this route i get this error: decoding str is not supported</p>
  
  <p>This function is working fine, it returns the list that i want.
  Code from the function i want to test:</p>
  
  <pre><code>@app.route('/users', methods=['GET'])
  @jwt_required
  def user_list():
  
  
  
      users = ldap.get_group_members('ship_crew')
      user_list = []
  
      for user in users:
          user_list.append((str(user, encoding='utf-8').split(",")[0].split("=")[1]))
      return jsonify(user_list)
  </code></pre>
  
  <p>Test code: </p>
  
  <pre><code>@patch('dev_maintenance.user_list.ldap.get_group_members')
  def test_content_type_json(get_group_members, access_token):
  
      get_group_members.return_value = ["cn=Philip J. Fry,ou=people,dc=planetexpress,dc=com",\
                                       "cn=Turanga Leela,ou=people,dc=planetexpress,dc=com",\
                                       "cn=Bender Bending Rodr\u00edguez,ou=people,dc=planetexpress,dc=com"]
  
      with app.test_client() as client:
  
          response = client.get('/users',
                                data=dict(user="hermes", passwd="hermes"),
                                headers={"Authorization": "Bearer {}".format(access_token)} )
  
      expected_json = ["Philip J. Fry", "Turanga Leela", "Bender Bending Rodr\u00edguez"]
  
      assert response.get_json() == expected_json
  </code></pre>
  
  <p>error:</p>
  
  <pre><code> @app.route('/users', methods=['GET'])
      @jwt_required
      def user_list():
  
  
  
          users = ldap.get_group_members('ship_crew')
          user_list = []
  
          for user in users:
  &gt;           user_list.append((str(user, encoding='utf-8').split(",")[0].split("=")[1]))
  E           TypeError: decoding str is not supported
  
  </code></pre>