There is a mechanical latch, but they seal much better once the aircraft is pressurized and the door is being pressed into the frame.
If you look at the windows on a research submersible, the Plexiglas windows are cone-shaped and placed facing the opposite direction from those on a plane, as the pressure there is coming from the outside. Same reason - the cone shape means the pressure differential creates a tighter seal as it becomes greater.
Story time: I was once on a Northwest flight, and a passenger in the exit row behind me called a flight attendant back while we were still loading. It seems she could put her arm out of the aircraft through a gap in the over-wing door opening. Sure enough, I look out my window and there's her hand waving back at me. They call a mechanic who reseals the exit (applying a new safety-wire seal) and off we go to our destination.
It almost certainly would have sealed shut once we got to altitude. And probably did for some unknown number of flights before she discovered the problem. But I definitely felt better once it had been repaired.
I was responding to a question about the difference between being on the ground and in the air, not one about the many other differences between this test and real-world operation.
They are plug doors, as with all other passenger jet airliners today. The door goes in at an angle (eg. 737) or part of it slides up/down (eg. 777) to fit through the door frame.