def setUp(self):
        from nuorisovaalit.run import main

        self.lock_dir = tempfile.mkdtemp()
        config = TEST_CONFIG.copy()
        config["session.lock_dir"] = self.lock_dir
        app = main({}, **config)
        self.testapp = webtest.TestApp(app, extra_environ=dict(REMOTE_ADDR="127.0.0.1"))
    def setUp(self):
        from nuorisovaalit.run import main

        self.lock_dir = tempfile.mkdtemp()
        config = TEST_CONFIG.copy()
        config["session.lock_dir"] = self.lock_dir
        config["nuorisovaalit.skip_voting_period_check"] = "true"
        app = main({}, **config)
        self.testapp = webtest.TestApp(app, extra_environ=dict(REMOTE_ADDR="127.0.0.1"))
        self.config = testing.setUp()
        populate_testing_db()