Change of ownership vehicles are not eligible for CAP assistance. However, California law requires the SELLER to provide a smog certificate. There are no exceptions. You can sign a document that says you will smog it, but the law says otherwise. This fact alone gives you leverage in court, if you have to pay for the repairs and end up in court to recover your money from the previous owner.
Pay for a diagnostic and go back to the previous owner to ask for help with his legal requirement to supply a passing smog check.