title: how to test edit route in CRUD application
body: <p>I have a route <code>/edit</code> with function <code>edit()</code> that edit or update user data, the URL when I click edit for a specefic user is like :</p>
  <blockquote>
  <p><a href="http://127.0.0.1:5000/users/edit?id=60b7764170e26432acfa6bb2" rel="nofollow noreferrer">http://127.0.0.1:5000/users/edit?id=60b7764170e26432acfa6bb2</a></p>
  </blockquote>
  <p>how can I write a unittest for this route, I didn't know how to pass the id to the test</p>
  <p>this is the route <strong>/edit</strong> with its function</p>
  <pre><code>@users.route('/edit', methods=['GET', 'POST'])
  @login_required
  def edit():
  
      id = request.args.get('id')
      user = User.objects.get_or_404(pk=id)
      form = UserForm(obj=user)
  
  
  
  
      if form.validate_on_submit():
          if user.update(username=form.username.data, firstname=form.firstname.data, 
          lastname=form.lastname.data, birthdate=form.birthdate.data, email=form.email.data, admin=form.admin.data, aktive=form.aktive.data):
              flash(&quot;user updated&quot;, &quot;success&quot;)
              return redirect(url_for('.index'))
          else:
              flash(&quot;user couldn't be updated&quot;, &quot;danger&quot;)
              return render_template('edit.html', user=user, form=form, info=session)
  
      return render_template('edit.html', user=user, form=form, info=session)
  </code></pre>