Remade tests with mock app, fixing everything along the way.