def test_api_submission_patch_correct():
    """Test that patching a submission to correct creates a solve"""
    app = create_ctfd()
    with app.app_context():
        register_user(app)
        gen_challenge(app.db)
        gen_fail(app.db, challenge_id=1, user_id=2)
        assert Solves.query.count() == 0
        with login_as_user(app, "admin") as client:
            r = client.patch("/api/v1/submissions/1", json={"type": "correct"})
            assert r.status_code == 200
            assert Fails.query.count() == 0
            assert Solves.query.count() == 1
            assert Discards.query.count() == 1
    destroy_ctfd(app)
Test that patching a submission to correct creates a solve
tests/api/v1/test_submissions.py