code: def test_author_required(app, client, auth):
      # change the post author to another user
      with app.app_context():
          db.session.get(Post, 1).author = db.session.get(User, 2)
          db.session.commit()
  
      auth.login()
      # current user can't modify other user's post
      assert client.post("/1/update").status_code == 403
      assert client.post("/1/delete").status_code == 403
      # current user doesn't see edit link
      assert 'href="/1/update"' not in client.get("/").text
  
file_path: flask-sqlalchemy/examples/flaskr/tests/test_blog.py
imports: import pytest
  from flaskr import db
  from flaskr.auth.models import User
  from flaskr.blog.models import Post
label_desc: Use image node_id 3 for calling a global function with example usage: test_author_required(app, client, auth) without return types