Do not disconnected the battery! It will cause all the emission monitors to clear out. Once that happens you'll need to drive your car through an emissions Drive Cycle (usually takes a few days of driving; around 100 miles or so) to get them to set. Emission monitors are internal self-tests which the emissions computer performs to ensure the engine is running efficiently. Without all the emission monitors "Ready" or "Complete", your car will fail the smog test... and yes, the check engine light will be off, but that won't stop your car from failing.
So best bet in this particular case, and since the check engine light turned off by itself, we'd recommend going ahead with the smog check now. The check engine light only turns off when the emissions computer detects that a fault no longer exists. In fact the computer double and sometimes even triple checks the emissions trouble before deciding that in fact the fault is fixed. The light then turns off. The one thing we do recommend though is that once you arrive at the smog station make sure to advise the smog technician that you recently made repairs to your vehicle because the check engine light was on.
posted by SmogTips Support