Skip to content

Commit

Permalink
Test SQL for Windows with Bernhard
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderWatzinger committed Nov 3, 2023
1 parent 55f576e commit 569555e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
10 changes: 3 additions & 7 deletions config/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@
IMAGE_SIZE = {
'thumbnail': '200',
'table': '100'}
IIIF = {
'enabled': False,
'path': '',
'url': '',
'version': 2,
'conversion': True,
'compression': 'deflate'} # 'deflate' or 'jpeg'

# Security
SESSION_COOKIE_SECURE = False # Should be True in production.py if using HTTPS
Expand All @@ -64,3 +57,6 @@
'button': {
'primary': 'btn btn-outline-primary btn-sm',
'secondary': 'btn btn-outline-secondary btn-sm'}}

# Tests
LOAD_WINDOWS_TEST_SQL = False
3 changes: 3 additions & 0 deletions install/data_test_windows.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- IIIF activation
UPDATE web.settings SET value = 'c:\iiif' WHERE name = 'iiif_path';
UPDATE web.settings SET value = 'http://localhost:8182/iiif/2/' WHERE name = 'iiif_url';
4 changes: 0 additions & 4 deletions instance/example_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,3 @@
'collection_ids': [0],
'base_url': 'https://arche-curation.acdh-dev.oeaw.ac.at/',
'thumbnail_url': 'https://arche-thumbnails.acdh.oeaw.ac.at/'}

# For Windows user
# from pathlib import Path
# TMP_PATH = Path('C:\\Path\\to\\tmp')
5 changes: 5 additions & 0 deletions tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ def setup_database(self) -> None:
Path(app.root_path).parent / 'install' /
f'{file_name}.sql', encoding='utf8') as sql_file:
self.cursor.execute(sql_file.read())
if app.config['LOAD_WINDOWS_TEST_SQL']:
with open(
Path(app.root_path).parent / 'install' /
f'data_test_windows.sql', encoding='utf8') as sql_file:
self.cursor.execute(sql_file.read())


class ApiTestCase(TestBaseCase):
Expand Down

0 comments on commit 569555e

Please sign in to comment.