California vehicle code section 24007 (b) 2
Section 24007 (b)(2) of the Vehicle Code states it is the responsibility of the seller to provide a valid smog certificate at the time of delivery of the vehicle. There is no provision in the law to sell a vehicle "as is."
Go back to the seller, inform them about Vehicle Code section 24007 (b)(2), and try to work things out amicably. If that fails, you have the option to pay for the repairs and the Smog Check yourself, and then take the seller to Small Claims Court to recover your costs. Although the law clearly supports the buyer, collecting on a small claims judgment can be difficult, so the amicable solution is usually best.
As far as the unregistered status, I know of no law preventing the sale, but you may get stuck for registering it, including late registration penalties.