Changeset View
Changeset View
Standalone View
Standalone View
swh/web/ui/tests/test_app.py
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | Returns: | ||||
- the main app without any decoration | - the main app without any decoration | ||||
NOT FOR PRODUCTION | NOT FOR PRODUCTION | ||||
""" | """ | ||||
storage = _init_mock_storage(base_url) | storage = _init_mock_storage(base_url) | ||||
# inject the mock data | # inject the mock data | ||||
conf = {'storage': storage, | conf = {'storage': storage, | ||||
'upload_folder': '/some/upload-dir', | |||||
'upload_allowed_extensions': ['txt'], | |||||
'max_upload_size': 1024} | |||||
zack: Default configuration values will be added to this test configuration, right? If so, you can… | |||||
Not Done Inline ActionsI believed so, but found out it wasn't the case when running the tests. I'm not quite sure why though, since the next lines should use the conf of the actual app if I have it running at the same time, which I am. jbertran: I believed so, but found out it wasn't the case when running the tests. I'm not quite sure why… | |||||
main.app.config.update({'conf': conf}) | main.app.config.update({'conf': conf}) | ||||
main.app.config['MAX_CONTENT_LENGTH'] = conf['max_upload_size'] | |||||
main.app.config['DEFAULT_RENDERERS'] = renderers.RENDERERS | main.app.config['DEFAULT_RENDERERS'] = renderers.RENDERERS | ||||
if not main.app.config['TESTING']: # HACK: install controllers only once! | if not main.app.config['TESTING']: # HACK: install controllers only once! | ||||
main.app.config['TESTING'] = True | main.app.config['TESTING'] = True | ||||
main.load_controllers() | main.load_controllers() | ||||
return main.app.test_client(), main.app.config, storage, main.app | return main.app.test_client(), main.app.config, storage, main.app | ||||
Show All 25 Lines |
Default configuration values will be added to this test configuration, right? If so, you can probably avoid setting max_log_revs explicitly here.