def setUp(self):
     app.testing = True
     app.config['SERVER_NAME'] = 'localhost'
     app.config['WTF_CSRF_ENABLED'] = False
     app.config['WTF_CSRF_METHODS'] = []  # This is the magic to disable CSRF for tests
     self.setup_database()
     self.app = app.test_client()
Beispiel #2
0
 def setUp(self):
     app.testing = True
     app.config['SERVER_NAME'] = 'localhost'
     app.config['WTF_CSRF_ENABLED'] = False
     app.config['WTF_CSRF_METHODS'] = [
     ]  # This is the magic to disable CSRF for tests
     self.setup_database()
     self.app = app.test_client()
Beispiel #3
0
    def setUp(self) -> None:
        app.testing = True
        app.config['SERVER_NAME'] = 'local.host'
        app.config['WTF_CSRF_ENABLED'] = False
        app.config['WTF_CSRF_METHODS'] = []  # Disable CSRF in tests

        self.setup_database()
        self.app = app.test_client()
        self.login()  # Login on default because needed almost everywhere
        with app.app_context():
            self.app.get('/')  # Needed to initialise g
            self.precision_geonames = \
                'reference_system_precision_' + \
                str(ReferenceSystem.get_by_name('GeoNames').id)
            self.precision_wikidata = \
                'reference_system_precision_' + \
                str(ReferenceSystem.get_by_name('Wikidata').id)
Beispiel #4
0
 def setUp(self):
     app.testing = True
     app.config['SERVER_NAME'] = 'localhost'
     app.config['WTF_CSRF_ENABLED'] = False
     self.setup_database()
     self.app = app.test_client()