Changeset fc99a86 for src/mapservice/codegen/templates
- Timestamp:
- Sep 8, 2019, 2:55:52 PM (7 years ago)
- Branches:
- debian/bullseye, master
- Children:
- 5446f28
- Parents:
- aa68798
- Location:
- src/mapservice/codegen/templates
- Files:
-
- 3 edited
-
__init__test.mustache (modified) (2 diffs)
-
__main__.mustache (modified) (2 diffs)
-
requirements.mustache (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/mapservice/codegen/templates/__init__test.mustache
raa68798 rfc99a86 4 4 from flask_cors import CORS 5 5 from flask_testing import TestCase 6 from sqlalchemy.event import listen 6 7 7 8 from {{packageName}}.encoder import JSONEncoder 9 from {{packageName}}.server_impl.database.Model import db, db_test_setup 8 10 9 from {{packageName}}.server_impl.database.Model import db, db_test_setup 11 def load_spatialite(dbapi_conn, connection_record): 12 print("enable spatial lite extension") 13 # From https://geoalchemy-2.readthedocs.io/en/latest/spatialite_tutorial.html 14 dbapi_conn.enable_load_extension(True) 15 dbapi_conn.load_extension('/usr/local/lib64/mod_spatialite') 10 16 11 17 class BaseTestCase(TestCase): … … 25 31 26 32 def setUp(self): 33 listen(db.engine, 'connect', load_spatialite) 27 34 db.drop_all() 28 35 db_test_setup() -
src/mapservice/codegen/templates/__main__.mustache
raa68798 rfc99a86 14 14 from {{packageName}} import encoder 15 15 16 from {{packageName}}.server_impl.database.Model import db, User, ApiKey, db_ test_setup16 from {{packageName}}.server_impl.database.Model import db, User, ApiKey, db_setup, db_test_setup 17 17 18 18 from {{packageName}}.server_impl.ValidatorWorkaround import ValidatorWorkaround … … 31 31 dbapi_conn.load_extension('/usr/local/lib64/mod_spatialite') 32 32 33 db_test_setup() 33 if flask.current_app.config['CREATE_TEST_DATABASE'] == True: 34 db_test_setup() 35 else: 36 db_setup() 34 37 35 38 @application.route("/mapservice/") -
src/mapservice/codegen/templates/requirements.mustache
raa68798 rfc99a86 9 9 flask-cors 10 10 shapely 11 geoalchemy2
Note:
See TracChangeset
for help on using the changeset viewer.
