core-parser-app 2.22.0__tar.gz → 2.23.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/PKG-INFO +14 -2
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/access_control.py +4 -2
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/static/core_parser_app/js/commons/file_uploader.js +1 -1
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/static/core_parser_app/js/modules.js +1 -6
- core_parser_app-2.23.1/core_parser_app/tools/modules/templates/core_parser_app/builtin/checkboxes.html +14 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/templates/core_parser_app/builtin/options.html +3 -3
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/templates/core_parser_app/builtin/textarea.html +1 -1
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/templates/core_parser_app/module.html +1 -3
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/views/builtin/checkboxes_module.py +13 -46
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/views/builtin/options_module.py +6 -12
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/views/module.py +0 -2
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/parser.py +18 -14
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/renderer/list.py +7 -7
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/renderer/xml.py +7 -2
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/views/user/ajax.py +2 -1
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app.egg-info/PKG-INFO +15 -3
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app.egg-info/SOURCES.txt +1 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app.egg-info/requires.txt +1 -1
- core_parser_app-2.23.1/requirements.core.txt +1 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/setup.py +1 -1
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/access_control/test_unit.py +12 -10
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/components/data_structure_element/test_int_access_control.py +9 -6
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tools/modules/tests/tests_unit_module.py +2 -2
- core_parser_app-2.23.1/tests/tools/modules/tests/tests_unit_options_module.py +60 -0
- core_parser_app-2.23.1/tests/tools/parser/renderer/list/tests_unit.py +478 -0
- core_parser_app-2.22.0/core_parser_app/tools/modules/templates/core_parser_app/builtin/checkboxes.html +0 -12
- core_parser_app-2.22.0/requirements.core.txt +0 -1
- core_parser_app-2.22.0/tests/tools/parser/renderer/list/tests_unit.py +0 -45
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/LICENSE.md +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/MANIFEST.in +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/README.rst +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/admin.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/apps.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/components/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/components/data_structure/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/components/data_structure/admin_site.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/components/data_structure/api.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/components/data_structure/models.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/components/data_structure_element/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/components/data_structure_element/admin_site.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/components/data_structure_element/api.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/components/module/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/components/module/admin_site.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/components/module/api.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/components/module/models.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/management/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/management/commands/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/management/commands/loadmodules.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/migrations/0001_initial.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/migrations/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/settings.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/static/core_parser_app/common/css/modules.css +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/static/core_parser_app/common/js/module_manager.js +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/static/core_parser_app/common/js/module_manager.raw.js +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/static/core_parser_app/common/xsd/annotations.xsd +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/static/core_parser_app/common/xsd/boolean.xsd +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/static/core_parser_app/common/xsd/date.xsd +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/system/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/system/api.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tasks.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/templates/core_parser_app/common/modals/add_module.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/templates/core_parser_app/common/module_manager.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/templates/core_parser_app/common/module_manager_box.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/templates/core_parser_app/common/modules.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/discover.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/exceptions.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/sanitize.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/static/core_parser_app/css/builtin/checkboxes.css +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/static/core_parser_app/css/builtin/textarea.css +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/static/core_parser_app/js/builtin/autocomplete.js +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/static/core_parser_app/js/builtin/checkboxes.js +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/static/core_parser_app/js/builtin/input.js +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/static/core_parser_app/js/builtin/options.js +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/static/core_parser_app/js/builtin/popup.js +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/static/core_parser_app/js/builtin/sync_input.js +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/static/core_parser_app/js/builtin/textarea.js +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/static/core_parser_app/js/modules.raw.js +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/static/core_parser_app/xsl/xsd2html4modules.xsl +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/templates/core_parser_app/builtin/autocomplete.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/templates/core_parser_app/builtin/input.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/templates/core_parser_app/builtin/input_button.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/templates/core_parser_app/builtin/modal_wrapper.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/templates/core_parser_app/builtin/popup.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/templates/core_parser_app/builtin/sync_input.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/templates/core_parser_app/commons/file_uploader.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/urls.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/views/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/views/builtin/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/views/builtin/autocomplete_module.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/views/builtin/input_button_module.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/views/builtin/input_module.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/views/builtin/popup_module.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/views/builtin/sync_input_module.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/views/builtin/textarea_module.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/views/views.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/modules/xpathaccessor.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/exceptions.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/renderer/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/renderer/checkbox.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/renderer/table.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/static/core_parser_app/css/use.css +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/static/core_parser_app/js/autosave.js +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/static/core_parser_app/js/autosave.raw.js +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/static/core_parser_app/js/autosave_checkbox.js +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/static/core_parser_app/js/buttons.js +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/static/core_parser_app/js/choice.js +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/templates/renderer/default/buttons/add.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/templates/renderer/default/buttons/collapse.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/templates/renderer/default/buttons/delete.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/templates/renderer/default/form-error.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/templates/renderer/default/inputs/boolean.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/templates/renderer/default/inputs/checkbox.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/templates/renderer/default/inputs/date.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/templates/renderer/default/inputs/input.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/templates/renderer/default/inputs/select.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/templates/renderer/default/test/sample_no_data.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/templates/renderer/default/test/sample_with_data.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/templates/renderer/default/ul.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/templates/renderer/default/warning.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/templates/renderer/list/attributes.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/templates/renderer/list/li.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/templates/renderer/list/ul.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/templates/renderer/table/table.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/templates/renderer/table/tr.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/templates/renderer/table/wrap.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/templates/renderer/xml/element.html +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/utils/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/utils/rendering.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/utils/xml.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/urls.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/utils/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/utils/xml.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/views/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/views/admin/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/views/admin/views.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/views/common/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/views/common/ajax.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/views/common/views.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/views/user/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app.egg-info/dependency_links.txt +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app.egg-info/top_level.txt +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/pyproject.toml +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/requirements.txt +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/setup.cfg +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/access_control/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/commands/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/commands/tests_unit.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/components/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/components/data_structure/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/components/data_structure/tests_int.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/components/data_structure/tests_unit.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/components/data_structure_element/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/components/data_structure_element/fixtures/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/components/data_structure_element/fixtures/fixtures.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/components/data_structure_element/tests_int.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/components/data_structure_element/tests_unit.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/components/module/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/components/module/tests_unit.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/discover/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/discover/tests_unit.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/fixtures_utils.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/models.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/rights.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tasks/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tasks/tests_unit.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/test_settings.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/test_utils.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tools/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tools/modules/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tools/modules/tests/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tools/modules/tests/tests_unit_checkboxes_module.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tools/modules/tests/tests_unit_sanitize.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tools/parser/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tools/parser/parser/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tools/parser/parser/test_choice.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tools/parser/parser/test_choice_extensions.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tools/parser/parser/test_complex_content.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tools/parser/parser/test_complex_type.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tools/parser/parser/test_element.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tools/parser/parser/test_extension.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tools/parser/parser/test_parser.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tools/parser/parser/test_restriction.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tools/parser/parser/test_sequence.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tools/parser/renderer/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tools/parser/renderer/list/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tools/parser/renderer/tests_unit.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/views/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/views/common/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/views/common/test_unit.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/views/user/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/views/user/ajax/__init__.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/views/user/ajax/fixtures.py +0 -0
- {core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/views/user/ajax/test_int_access_control.py +0 -0
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: core_parser_app
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.23.1
|
|
4
4
|
Summary: XSD parser tools for the curator core project
|
|
5
5
|
Home-page: https://github.com/usnistgov/core_parser_app
|
|
6
6
|
Author: NIST IT Lab
|
|
7
7
|
Author-email: itl_inquiries@nist.gov
|
|
8
8
|
License-File: LICENSE.md
|
|
9
|
+
Requires-Dist: celery
|
|
10
|
+
Requires-Dist: Django
|
|
11
|
+
Requires-Dist: djangorestframework
|
|
12
|
+
Requires-Dist: lxml==6.1.*
|
|
13
|
+
Requires-Dist: core-main-app==2.23.*
|
|
14
|
+
Dynamic: author
|
|
15
|
+
Dynamic: author-email
|
|
16
|
+
Dynamic: description
|
|
17
|
+
Dynamic: home-page
|
|
18
|
+
Dynamic: license-file
|
|
19
|
+
Dynamic: requires-dist
|
|
20
|
+
Dynamic: summary
|
|
9
21
|
|
|
10
22
|
===============
|
|
11
23
|
Core Parser App
|
|
@@ -57,8 +57,10 @@ def _check_data_structure_element_ownership(data_structure_element, user):
|
|
|
57
57
|
Returns:
|
|
58
58
|
|
|
59
59
|
"""
|
|
60
|
-
if
|
|
61
|
-
|
|
60
|
+
user_id = str(user.id) if (user and not user.is_anonymous) else None
|
|
61
|
+
if (
|
|
62
|
+
not data_structure_element.user
|
|
63
|
+
or data_structure_element.user != user_id
|
|
62
64
|
):
|
|
63
65
|
raise AccessControlError("User is not the owner of the object.")
|
|
64
66
|
|
|
@@ -72,12 +72,7 @@ var saveModuleData = function($module, modData, asyncOpt) {
|
|
|
72
72
|
var moduleResult = $(data.html).find('.moduleResult').html();
|
|
73
73
|
|
|
74
74
|
$module.find('.moduleDisplay').html(moduleDisplay);
|
|
75
|
-
$module.find('.moduleResult').
|
|
76
|
-
|
|
77
|
-
/* look at extra data received from the server */
|
|
78
|
-
/*if ('xpath_accessor' in data){
|
|
79
|
-
xpath_accessor(data.xpath_accessor);
|
|
80
|
-
}*/
|
|
75
|
+
$module.find('.moduleResult').text(moduleResult);
|
|
81
76
|
},
|
|
82
77
|
error: function() {
|
|
83
78
|
console.error("An error occurred when saving module data");
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<div class="mod_checkboxes">
|
|
2
|
+
{% if label %}
|
|
3
|
+
<label>{{ label }}</label>
|
|
4
|
+
{% endif %}
|
|
5
|
+
<div class="row">
|
|
6
|
+
{% for col in columns %}
|
|
7
|
+
<div class="col">
|
|
8
|
+
{% for item in col %}
|
|
9
|
+
<span><input type="checkbox" {% if item.checked %}checked{% endif %} value="{{ item.key }}"/>{{ item.val }}</span>
|
|
10
|
+
{% endfor %}
|
|
11
|
+
</div>
|
|
12
|
+
{% endfor %}
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
{%else%}
|
|
9
9
|
<select>
|
|
10
10
|
{% endif %}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
{% for opt in options%}
|
|
12
|
+
<option value="{{ opt.key }}" {% if opt.selected%}selected{% endif %}>{{ opt.val }}</option>
|
|
13
|
+
{% endfor %}
|
|
14
14
|
</select>
|
|
15
15
|
</div>
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
{% autoescape off %}
|
|
2
1
|
<div class='module' style='display: inline' id="{{ module_id }}">
|
|
3
2
|
<div class='moduleContent'>{{module}}</div>
|
|
4
3
|
<div class='moduleDisplay'>{{display}}</div>
|
|
5
4
|
<div class='moduleURL' style='display: none'>{{url}}</div>
|
|
6
|
-
</div>
|
|
7
|
-
{% endautoescape %}
|
|
5
|
+
</div>
|
|
@@ -46,26 +46,6 @@ class AbstractCheckboxesModule(AbstractModule, metaclass=ABCMeta):
|
|
|
46
46
|
self.options = options if options is not None else dict()
|
|
47
47
|
self.label = label
|
|
48
48
|
|
|
49
|
-
# FIXME: use a template to generate the HTML of the checkbox
|
|
50
|
-
@staticmethod
|
|
51
|
-
def _create_html_checkbox(input_key, input_value, checked=False):
|
|
52
|
-
"""Return the html of the checkboxes
|
|
53
|
-
|
|
54
|
-
Args:
|
|
55
|
-
input_key:
|
|
56
|
-
input_value:
|
|
57
|
-
checked:
|
|
58
|
-
|
|
59
|
-
Returns:
|
|
60
|
-
|
|
61
|
-
"""
|
|
62
|
-
input_tag = '<input type="checkbox" '
|
|
63
|
-
if checked:
|
|
64
|
-
input_tag += "checked "
|
|
65
|
-
input_tag += 'value="' + input_key + '"/> ' + input_value
|
|
66
|
-
|
|
67
|
-
return "<span>" + input_tag + "</span>"
|
|
68
|
-
|
|
69
49
|
def _render_module(self, request):
|
|
70
50
|
"""Return the module
|
|
71
51
|
|
|
@@ -77,36 +57,23 @@ class AbstractCheckboxesModule(AbstractModule, metaclass=ABCMeta):
|
|
|
77
57
|
"""
|
|
78
58
|
# Compute number of items in each columns
|
|
79
59
|
col_nb = 3
|
|
80
|
-
opt_nb = len(self.options)
|
|
81
|
-
max_item_nb = opt_nb // col_nb
|
|
82
60
|
|
|
83
61
|
# Parameters initialization
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
params["column" + str(col_id)] = checkboxes_html
|
|
97
|
-
|
|
98
|
-
checkboxes_html = ""
|
|
99
|
-
item_nb = 0
|
|
100
|
-
col_id += 1
|
|
101
|
-
|
|
102
|
-
checkboxes_html += AbstractCheckboxesModule._create_html_checkbox(
|
|
103
|
-
key,
|
|
104
|
-
val,
|
|
105
|
-
checked=(key in self.selected if self.selected else False),
|
|
62
|
+
columns = [[] for _ in range(col_nb)]
|
|
63
|
+
|
|
64
|
+
for i, (key, val) in enumerate(self.options.items()):
|
|
65
|
+
col_id = i % col_nb
|
|
66
|
+
columns[col_id].append(
|
|
67
|
+
{
|
|
68
|
+
"key": key,
|
|
69
|
+
"val": val,
|
|
70
|
+
"checked": (
|
|
71
|
+
key in self.selected if self.selected else False
|
|
72
|
+
),
|
|
73
|
+
}
|
|
106
74
|
)
|
|
107
|
-
item_nb += 1
|
|
108
75
|
|
|
109
|
-
params
|
|
76
|
+
params = {"columns": columns}
|
|
110
77
|
|
|
111
78
|
if self.label is not None:
|
|
112
79
|
params.update({"label": self.label})
|
|
@@ -47,22 +47,16 @@ class AbstractOptionsModule(AbstractModule, metaclass=ABCMeta):
|
|
|
47
47
|
Returns:
|
|
48
48
|
|
|
49
49
|
"""
|
|
50
|
-
options_html = ""
|
|
51
|
-
|
|
52
50
|
if self.selected not in list(self.options.keys()):
|
|
53
51
|
self.selected = None
|
|
54
52
|
|
|
53
|
+
options_list = []
|
|
55
54
|
for key, val in list(self.options.items()):
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
options_html += (
|
|
62
|
-
"<option value='" + key + "'>" + val + "</option>"
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
params = {"options": options_html}
|
|
55
|
+
options_list.append(
|
|
56
|
+
{"key": key, "val": val, "selected": (self.selected == key)}
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
params = {"options": options_list}
|
|
66
60
|
|
|
67
61
|
if self.label is not None:
|
|
68
62
|
params.update({"label": self.label})
|
|
@@ -17,6 +17,7 @@ from core_main_app.utils.requests_utils.requests_utils import send_get_request
|
|
|
17
17
|
from core_main_app.utils.xsd_flattener.xsd_flattener_database_url import (
|
|
18
18
|
XSDFlattenerDatabaseOrURL,
|
|
19
19
|
)
|
|
20
|
+
from core_main_app.utils.validation import url_validation
|
|
20
21
|
from core_parser_app.components.data_structure.models import (
|
|
21
22
|
DataStructureElement,
|
|
22
23
|
)
|
|
@@ -223,7 +224,7 @@ def update_root_xpath(element, xpath, index, request=None):
|
|
|
223
224
|
update_root_xpath(child, xpath, index, request)
|
|
224
225
|
|
|
225
226
|
|
|
226
|
-
def get_nodes_xpath(elements, xml_tree, download_enabled=
|
|
227
|
+
def get_nodes_xpath(elements, xml_tree, download_enabled=False, request=None):
|
|
227
228
|
"""Perform a lookup in subelements to build xpath.
|
|
228
229
|
|
|
229
230
|
Get nodes' xpath, only one level deep. It's not going to every leaves. Only
|
|
@@ -295,7 +296,7 @@ def lookup_occurs(
|
|
|
295
296
|
xml_tree,
|
|
296
297
|
full_path,
|
|
297
298
|
edit_data_tree,
|
|
298
|
-
download_enabled=
|
|
299
|
+
download_enabled=False,
|
|
299
300
|
request=None,
|
|
300
301
|
):
|
|
301
302
|
"""Lookup in data to get the number of occurrences of a sequence or choice
|
|
@@ -420,7 +421,7 @@ def get_element_type(
|
|
|
420
421
|
target_namespace_prefix,
|
|
421
422
|
schema_location=None,
|
|
422
423
|
attr="type",
|
|
423
|
-
download_enabled=
|
|
424
|
+
download_enabled=False,
|
|
424
425
|
request=None,
|
|
425
426
|
):
|
|
426
427
|
"""Get XSD type to render. Returns the tree where the type was found.
|
|
@@ -536,7 +537,7 @@ def get_element_type(
|
|
|
536
537
|
return element_type, xml_tree, schema_location
|
|
537
538
|
|
|
538
539
|
|
|
539
|
-
def import_xml_tree(el_import, download_enabled=
|
|
540
|
+
def import_xml_tree(el_import, download_enabled=False, request=None):
|
|
540
541
|
"""
|
|
541
542
|
Return tree after downloading import's schemaLocation
|
|
542
543
|
|
|
@@ -552,7 +553,8 @@ def import_xml_tree(el_import, download_enabled=True, request=None):
|
|
|
552
553
|
|
|
553
554
|
if not download_enabled:
|
|
554
555
|
raise ParserError("Dependency could not be downloaded")
|
|
555
|
-
|
|
556
|
+
# validate url
|
|
557
|
+
url_validation(ref_xml_schema_url)
|
|
556
558
|
# download the file
|
|
557
559
|
ref_xml_schema_file = send_get_request(ref_xml_schema_url)
|
|
558
560
|
# read the content of the file
|
|
@@ -582,7 +584,7 @@ def get_ref_element(
|
|
|
582
584
|
namespaces,
|
|
583
585
|
element_tag,
|
|
584
586
|
schema_location=None,
|
|
585
|
-
download_enabled=
|
|
587
|
+
download_enabled=False,
|
|
586
588
|
request=None,
|
|
587
589
|
):
|
|
588
590
|
"""
|
|
@@ -849,9 +851,9 @@ class XSDParser:
|
|
|
849
851
|
min_tree=True,
|
|
850
852
|
ignore_modules=False,
|
|
851
853
|
collapse=True,
|
|
852
|
-
auto_key_keyref=
|
|
854
|
+
auto_key_keyref=False,
|
|
853
855
|
implicit_extension_base=False,
|
|
854
|
-
download_dependencies=
|
|
856
|
+
download_dependencies=False,
|
|
855
857
|
store_type=False,
|
|
856
858
|
request=None,
|
|
857
859
|
):
|
|
@@ -1442,9 +1444,10 @@ class XSDParser:
|
|
|
1442
1444
|
# open the imported file
|
|
1443
1445
|
download_enabled = self.download_dependencies
|
|
1444
1446
|
if download_enabled:
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
)
|
|
1447
|
+
# validate url
|
|
1448
|
+
schema_location_url = schema_element.options["schema_location"]
|
|
1449
|
+
url_validation(schema_location_url)
|
|
1450
|
+
ref_xml_schema_file = send_get_request(schema_location_url)
|
|
1448
1451
|
# get the content of the file
|
|
1449
1452
|
ref_xml_schema_content = ref_xml_schema_file.content
|
|
1450
1453
|
# build the XML tree
|
|
@@ -2036,9 +2039,10 @@ class XSDParser:
|
|
|
2036
2039
|
# open the imported file
|
|
2037
2040
|
download_enabled = self.download_dependencies
|
|
2038
2041
|
if download_enabled:
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
)
|
|
2042
|
+
# validate url
|
|
2043
|
+
schema_location_url = element.options["schema_location"]
|
|
2044
|
+
url_validation(schema_location_url)
|
|
2045
|
+
ref_xml_schema_file = send_get_request(schema_location_url)
|
|
2042
2046
|
# get the content of the file
|
|
2043
2047
|
ref_xml_schema_content = ref_xml_schema_file.content
|
|
2044
2048
|
# build the XML tree
|
{core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/renderer/list.py
RENAMED
|
@@ -4,6 +4,7 @@ import logging
|
|
|
4
4
|
from os.path import join
|
|
5
5
|
|
|
6
6
|
from django.template import loader
|
|
7
|
+
from django.utils.html import escape
|
|
7
8
|
|
|
8
9
|
from core_parser_app.components.module import api as module_api
|
|
9
10
|
from core_parser_app.tools.modules.views.module import AbstractModule
|
|
@@ -179,7 +180,7 @@ class ListRenderer(AbstractListRenderer):
|
|
|
179
180
|
element_name = element.options["name"]
|
|
180
181
|
|
|
181
182
|
if "label" in element.options and element.options["label"] != "":
|
|
182
|
-
element_name = element.options["label"]
|
|
183
|
+
element_name = escape(element.options["label"])
|
|
183
184
|
|
|
184
185
|
for child_key in child_keys:
|
|
185
186
|
# FIXME Use tuples instead
|
|
@@ -331,7 +332,7 @@ class ListRenderer(AbstractListRenderer):
|
|
|
331
332
|
element_name = element.options["name"]
|
|
332
333
|
|
|
333
334
|
if "label" in element.options and element.options["label"] != "":
|
|
334
|
-
element_name = element.options["label"]
|
|
335
|
+
element_name = escape(element.options["label"])
|
|
335
336
|
|
|
336
337
|
for child_key in child_keys:
|
|
337
338
|
sub_elements = []
|
|
@@ -607,7 +608,7 @@ class ListRenderer(AbstractListRenderer):
|
|
|
607
608
|
)
|
|
608
609
|
|
|
609
610
|
label = (
|
|
610
|
-
element.options["label"]
|
|
611
|
+
escape(element.options["label"])
|
|
611
612
|
if "label" in element.options
|
|
612
613
|
else "Choice"
|
|
613
614
|
)
|
|
@@ -791,9 +792,7 @@ class ListRenderer(AbstractListRenderer):
|
|
|
791
792
|
module_url = module_options["url"]
|
|
792
793
|
|
|
793
794
|
module = module_api.get_by_url(module_url)
|
|
794
|
-
module_view = AbstractModule.get_view_from_view_path(
|
|
795
|
-
module.view
|
|
796
|
-
).as_view()
|
|
795
|
+
module_view = AbstractModule.get_view_from_view_path(module.view)()
|
|
797
796
|
|
|
798
797
|
module_request = self.request
|
|
799
798
|
module_request.method = "GET"
|
|
@@ -813,7 +812,8 @@ class ListRenderer(AbstractListRenderer):
|
|
|
813
812
|
module_request.GET["attributes"] = module_options["attributes"]
|
|
814
813
|
|
|
815
814
|
# renders the module
|
|
816
|
-
|
|
815
|
+
module_view.request = module_request
|
|
816
|
+
return module_view._get(module_request).content.decode("utf-8")
|
|
817
817
|
|
|
818
818
|
def _render_list_attributes(
|
|
819
819
|
self, attributes, html_content, simple_element
|
{core_parser_app-2.22.0 → core_parser_app-2.23.1}/core_parser_app/tools/parser/renderer/xml.py
RENAMED
|
@@ -5,6 +5,7 @@ import numbers
|
|
|
5
5
|
from os.path import join
|
|
6
6
|
|
|
7
7
|
from django.template import loader
|
|
8
|
+
from django.utils.html import escape
|
|
8
9
|
|
|
9
10
|
from xml_utils.xsd_tree.operations.xml_entities import XmlEntities
|
|
10
11
|
from core_parser_app.components.data_structure_element import (
|
|
@@ -584,9 +585,13 @@ class XmlRenderer(AbstractXmlRenderer):
|
|
|
584
585
|
elif child.tag == "attribute":
|
|
585
586
|
tmp_content[0] = self.render_attribute(child)
|
|
586
587
|
elif child.tag == "union":
|
|
587
|
-
tmp_content[1] =
|
|
588
|
+
tmp_content[1] = escape(
|
|
589
|
+
child.value if child.value is not None else ""
|
|
590
|
+
)
|
|
588
591
|
elif child.tag == "list":
|
|
589
|
-
tmp_content[1] =
|
|
592
|
+
tmp_content[1] = escape(
|
|
593
|
+
child.value if child.value is not None else ""
|
|
594
|
+
)
|
|
590
595
|
elif child.tag == "module":
|
|
591
596
|
if child.options["multiple"]:
|
|
592
597
|
tmp_content[2] = self.render_module(child)[1]
|
|
@@ -10,6 +10,7 @@ from core_main_app.commons.exceptions import DoesNotExist
|
|
|
10
10
|
from core_parser_app.components.data_structure_element import (
|
|
11
11
|
api as data_structure_element_api,
|
|
12
12
|
)
|
|
13
|
+
from core_parser_app.tools.modules.sanitize import sanitize
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
@login_required
|
|
@@ -80,7 +81,7 @@ def save_data_structure_element_value(request):
|
|
|
80
81
|
)
|
|
81
82
|
|
|
82
83
|
input_previous_value = input_element.value
|
|
83
|
-
input_element.value = request.POST["value"]
|
|
84
|
+
input_element.value = sanitize(request.POST["value"])
|
|
84
85
|
data_structure_element_api.upsert(input_element, request)
|
|
85
86
|
|
|
86
87
|
return HttpResponse(
|
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
2
|
-
Name:
|
|
3
|
-
Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: core_parser_app
|
|
3
|
+
Version: 2.23.1
|
|
4
4
|
Summary: XSD parser tools for the curator core project
|
|
5
5
|
Home-page: https://github.com/usnistgov/core_parser_app
|
|
6
6
|
Author: NIST IT Lab
|
|
7
7
|
Author-email: itl_inquiries@nist.gov
|
|
8
8
|
License-File: LICENSE.md
|
|
9
|
+
Requires-Dist: celery
|
|
10
|
+
Requires-Dist: Django
|
|
11
|
+
Requires-Dist: djangorestframework
|
|
12
|
+
Requires-Dist: lxml==6.1.*
|
|
13
|
+
Requires-Dist: core-main-app==2.23.*
|
|
14
|
+
Dynamic: author
|
|
15
|
+
Dynamic: author-email
|
|
16
|
+
Dynamic: description
|
|
17
|
+
Dynamic: home-page
|
|
18
|
+
Dynamic: license-file
|
|
19
|
+
Dynamic: requires-dist
|
|
20
|
+
Dynamic: summary
|
|
9
21
|
|
|
10
22
|
===============
|
|
11
23
|
Core Parser App
|
|
@@ -167,6 +167,7 @@ tests/tools/modules/__init__.py
|
|
|
167
167
|
tests/tools/modules/tests/__init__.py
|
|
168
168
|
tests/tools/modules/tests/tests_unit_checkboxes_module.py
|
|
169
169
|
tests/tools/modules/tests/tests_unit_module.py
|
|
170
|
+
tests/tools/modules/tests/tests_unit_options_module.py
|
|
170
171
|
tests/tools/modules/tests/tests_unit_sanitize.py
|
|
171
172
|
tests/tools/parser/__init__.py
|
|
172
173
|
tests/tools/parser/parser/__init__.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
core-main-app==2.23.*
|
|
@@ -41,7 +41,7 @@ required = [req_link(r) if r.startswith("https://") else r for r in required]
|
|
|
41
41
|
|
|
42
42
|
setup(
|
|
43
43
|
name="core_parser_app",
|
|
44
|
-
version="2.
|
|
44
|
+
version="2.23.1",
|
|
45
45
|
description="XSD parser tools for the curator core project",
|
|
46
46
|
long_description=long_desc,
|
|
47
47
|
author="NIST IT Lab",
|
|
@@ -48,16 +48,18 @@ class TestCheckDataStructureElementOwnership(TestCase):
|
|
|
48
48
|
self.mock_owned_dse, self.users["anon"]
|
|
49
49
|
)
|
|
50
50
|
|
|
51
|
-
def
|
|
52
|
-
"""
|
|
51
|
+
def test_anon_data_structure_random_user_fail(self):
|
|
52
|
+
"""test_anon_data_structure_random_user_fail"""
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
with self.assertRaises(AccessControlError):
|
|
55
|
+
_check_data_structure_element_ownership(
|
|
56
|
+
self.mock_anon_dse, self.users["random"]
|
|
57
|
+
)
|
|
57
58
|
|
|
58
|
-
def
|
|
59
|
-
"""
|
|
59
|
+
def test_anon_data_structure_anon_user_fail(self):
|
|
60
|
+
"""test_anon_data_structure_anon_user_fail"""
|
|
60
61
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
with self.assertRaises(AccessControlError):
|
|
63
|
+
_check_data_structure_element_ownership(
|
|
64
|
+
self.mock_anon_dse, self.users["anon"]
|
|
65
|
+
)
|
|
@@ -579,13 +579,16 @@ class TestDataStructureElementPermissionWithoutOwners(IntegrationBaseTestCase):
|
|
|
579
579
|
user=AnonymousUser(), data_structure_class=MockAnonDataStructure
|
|
580
580
|
)
|
|
581
581
|
|
|
582
|
-
def
|
|
583
|
-
|
|
582
|
+
def test_anon_user_access_dse_if_permission_and_no_owner_raises_error(
|
|
583
|
+
self,
|
|
584
|
+
):
|
|
585
|
+
"""test_anon_user_access_dse_if_permission_and_no_owner_raises_error"""
|
|
584
586
|
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
587
|
+
with self.assertRaises(AccessControlError):
|
|
588
|
+
_check_data_structure_elements_access(
|
|
589
|
+
[self.fixtures.data_structure_element_collection["root"]],
|
|
590
|
+
AnonymousUser(),
|
|
591
|
+
)
|
|
589
592
|
|
|
590
593
|
|
|
591
594
|
class TestDataStructureElementPermissionWithoutOwnersWithoutPerm(
|
{core_parser_app-2.22.0 → core_parser_app-2.23.1}/tests/tools/modules/tests/tests_unit_module.py
RENAMED
|
@@ -90,7 +90,7 @@ class TestGet(TestCase):
|
|
|
90
90
|
)
|
|
91
91
|
mock_render_template.return_value = ""
|
|
92
92
|
|
|
93
|
-
response = module_object.
|
|
93
|
+
response = module_object._get(request)
|
|
94
94
|
|
|
95
95
|
self.assertTrue(isinstance(response, HttpResponse))
|
|
96
96
|
|
|
@@ -124,7 +124,7 @@ class TestGet(TestCase):
|
|
|
124
124
|
)
|
|
125
125
|
mock_render_template.return_value = ""
|
|
126
126
|
|
|
127
|
-
module_object.
|
|
127
|
+
module_object._get(request)
|
|
128
128
|
|
|
129
129
|
self.assertTrue(
|
|
130
130
|
data_structure_element.options["data"] == "module result"
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"""Checkboxes module unit testing"""
|
|
2
|
+
|
|
3
|
+
from unittest.case import TestCase
|
|
4
|
+
|
|
5
|
+
from core_main_app.utils.tests_tools.MockUser import create_mock_user
|
|
6
|
+
from core_main_app.utils.tests_tools.RequestMock import create_mock_request
|
|
7
|
+
from core_parser_app.tools.modules.views.builtin.options_module import (
|
|
8
|
+
AbstractOptionsModule,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class TestOptionsModule(TestCase):
|
|
13
|
+
"""Test options module"""
|
|
14
|
+
|
|
15
|
+
def test_init_module_set_default_resources(self):
|
|
16
|
+
"""test_init_module_set_default_resources"""
|
|
17
|
+
|
|
18
|
+
test_options = {"1": "Option One", "2": "Option Two"}
|
|
19
|
+
module_object = OptionsModule(options=test_options, selected="1")
|
|
20
|
+
|
|
21
|
+
self.assertEqual(
|
|
22
|
+
module_object.scripts, ["core_parser_app/js/builtin/options.js"]
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
def test_render_module_with_options(self):
|
|
26
|
+
"""test_render_module_with_options"""
|
|
27
|
+
|
|
28
|
+
test_options = {"1": "Option One", "2": "Option Two"}
|
|
29
|
+
module_object = OptionsModule(options=test_options, selected="1")
|
|
30
|
+
|
|
31
|
+
mock_user = create_mock_user("1", is_superuser=True)
|
|
32
|
+
mock_request = create_mock_request(user=mock_user)
|
|
33
|
+
|
|
34
|
+
html_result = module_object._render_module(mock_request)
|
|
35
|
+
self.assertTrue("Option One" in html_result)
|
|
36
|
+
self.assertTrue("Option Two" in html_result)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class OptionsModule(AbstractOptionsModule):
|
|
40
|
+
"""Module Implementation"""
|
|
41
|
+
|
|
42
|
+
def _retrieve_data(self, request):
|
|
43
|
+
"""_retrieve_data
|
|
44
|
+
Args:
|
|
45
|
+
request:
|
|
46
|
+
|
|
47
|
+
Returns:
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
return "module result"
|
|
51
|
+
|
|
52
|
+
def _render_data(self, request):
|
|
53
|
+
"""_render_data
|
|
54
|
+
Args:
|
|
55
|
+
request:
|
|
56
|
+
|
|
57
|
+
Returns:
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
return "module display"
|