Lindsay Lohan Shoots Pre-Court COMEDY Sketch

6/23/2011 8:30 AM PDT

Lindsay Lohan Shoots Pre-Court COMEDY Sketch

Lindsay Lohan yukked it up big time yesterday before news broke that she tested positive for alcohol -- because TMZ has learned, the actress was shooting a COMEDY sketch ... inside her apartment.

It was all for Air New Zealand -- we're told Lindsay struck a deal with the airline to shoot a funny puppet-filled webisode to promote some new airplane product ... and cameras rolled yesterday ... just hours before the booze news.

To give you an idea of the kind of project it is -- check out the one Snoop did for ANZ back in March. It's funny, but given Lindsay's current situation ... the timing ain't ideal for her.

Lindsay JUST arrived to court to face the music after flunking an alcohol test earlier this month -- and she could face real jail time.