コード例 #1
0
    def setUp(self):
        # set up fake test browser
        self.client = app.test_client()

        # connect to temporary database
        connect_to_db(app, "sqlite:///")

        # This line makes a 500 error in a route raise an error in a test
        app.config['TESTING'] = True

        # create tables and add sample data
        db.create_all()
        example_data_rec_areas()
        example_data_users()
        example_data_visits()
コード例 #2
0
ファイル: tests.py プロジェクト: benpence/parks-map
    def setUp(self):
        # set up fake test browser
        self.client = app.test_client()

        # connect to temporary database
        connect_to_db(app, "sqlite:///")

        # This line makes a 500 error in a route raise an error in a test
        app.config['TESTING'] = True

        # create tables and add sample data
        db.create_all()
        example_data_rec_areas()
        example_data_users()
        example_data_visits()
コード例 #3
0
    def setUp(self):
        # set up fake test browser
        self.client = app.test_client()

        # connect to temporary database
        connect_to_db(app, "sqlite:///")

        # This line makes a 500 error in a route raise an error in a test
        app.config['TESTING'] = True

        # create tables and add sample data
        db.create_all()
        example_data_rec_areas()
        example_data_users()
        example_data_visits()

        # initiate a session
        with self.client as c:
            with c.session_transaction() as sess:
                sess['user'] = '******'
            c.set_cookie('localhost', 'MYCOOKIE', 'cookie_value')
コード例 #4
0
ファイル: tests.py プロジェクト: benpence/parks-map
    def setUp(self):
        # set up fake test browser
        self.client = app.test_client()

        # connect to temporary database
        connect_to_db(app, "sqlite:///")

        # This line makes a 500 error in a route raise an error in a test
        app.config['TESTING'] = True

        # create tables and add sample data
        db.create_all()
        example_data_rec_areas()
        example_data_users()
        example_data_visits()

        # initiate a session
        with self.client as c:
                with c.session_transaction() as sess:
                    sess['user'] = '******'
                c.set_cookie('localhost', 'MYCOOKIE', 'cookie_value')