title: Flask-testing : self.client.delete() return 200 but fail as he doesnt delete anything
body: <p>I have a CRUD football player flask app using SQL Alchemy and postgresql.
  I'm trying to test it with unittest and flask-testing but when I test delete and patch request on a player (based on his number), the statut returned is 200 but the player isn't deleted from the database so the test fail.</p>
  
  <p>My app.py :</p>
  
  <pre><code>app = Flask(__name__)
  app.config['SQLALCHEMY_DATABASE_URI']='postgresql://postgres:password@localhost:5432/flask-sql-alchemy'
  app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
  db = SQLAlchemy(app)
  modus = Modus(app)
  
  
  class om_player(db.Model):
  
      __tablename__ = "players"
  
      id = db.Column(db.Integer, primary_key=True)
      name = db.Column(db.Text)
      number = db.Column(db.Integer)
      age = db.Column(db.Integer)
  
      def __init__(self, name, number, age):
          self.name = name
          self.number = number
          self.age = age
  
  @app.route('/joueurs/&lt;int:number&gt;', methods=["GET", "PATCH", "DELETE"])
  def show(number):
      found_player = om_player.query.filter_by(number=number).first()
  
      if request.method == b"PATCH":
          found_player.name = request.form['name']
          found_player.number = request.form['number']
          found_player.age = request.form['age']
          db.session.add(found_player)
          db.session.commit()
          return redirect(url_for('show', number=request.form['number']))
      if request.method == b"DELETE":
          db.session.delete(found_player)
          db.session.commit()
          return redirect(url_for('joueurs'))
      return render_template('show.html', player=found_player)
  </code></pre>
  
  <p>My test.py:</p>
  
  <pre><code>from app import app,db, om_player
  from flask_testing import TestCase
  import unittest
  
  class BaseTestCase(TestCase):
      def create_app(self):
          app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://postgres:password@localhost:5432/flask-sql-alchemy'
          app.config['PRESERVE_CONTEXT_ON_EXCEPTION'] = False
          return app
  
      def test_delete(self):
          response = self.client.delete('/joueurs/18', follow_redirects=True)
          self.assertEqual(response.status_code, 200)
          self.assertNotIn(b"AMAVI", response.data)
  
  
  if __name__ == '__main__':
      unittest.main()
  </code></pre>
  
  <p>(joueurs means players in french)</p>
  
  <p>When I run python test.py :</p>
  
  <p>AssertionError: b'AMAVI' unexpectedly found in b'my edit.html file'</p>
  
  <p>So the player with number 18 and named "AMAVI" is not deleted and I don't understand why since the delete request return 200 and my app is working fine in local server.</p>