def METHOD_NAME(
    user_factory, post_factory, context_factory, fake_datetime
):
    user = user_factory()
    post = post_factory()
    db.session.add(post)
    db.session.commit()
    with patch("szurubooru.func.posts.serialize_post"):
        with fake_datetime("1997-12-01"):
            api.post_api.add_post_to_favorites(
                context_factory(user=user), {"post_id": post.post_id}
            )
        with fake_datetime("1997-12-02"):
            api.post_api.delete_post_from_favorites(
                context_factory(user=user), {"post_id": post.post_id}
            )
        with fake_datetime("1997-12-02"):
            api.post_api.delete_post_from_favorites(
                context_factory(user=user), {"post_id": post.post_id}
            )
        post = db.session.query(model.Post).one()
        assert db.session.query(model.PostFavorite).count() == 0
        assert post.favorite_count == 0