def app(request): global fixture if fixture is None: fixture = Application() else: if not fixture.isValid(): fixture = Application() fixture.session.ensureLogin(userName="******", password="******") return fixture