invenio-app-rdm 13.0.0b4.dev1__py2.py3-none-any.whl → 14.0.0b1.dev8__py2.py3-none-any.whl
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.
- invenio_app_rdm/__init__.py +1 -1
- invenio_app_rdm/administration/moderation/__init__.py +11 -0
- invenio_app_rdm/administration/moderation/requests.py +175 -0
- invenio_app_rdm/administration/records/records.py +9 -7
- invenio_app_rdm/administration/templates/semantic-ui/invenio_app_rdm/administration/requests.html +14 -0
- invenio_app_rdm/administration/templates/semantic-ui/invenio_app_rdm/administration/requests_details.html +91 -0
- invenio_app_rdm/administration/user_moderation/user_moderation.py +4 -4
- invenio_app_rdm/administration/users/users.py +0 -5
- invenio_app_rdm/communities_ui/views/communities.py +9 -5
- invenio_app_rdm/config.py +73 -4
- invenio_app_rdm/ext.py +2 -2
- invenio_app_rdm/fixtures/pages.py +5 -2
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/deposit.html +11 -0
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/detail.html +2 -5
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/citation.html +2 -2
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/details.html +2 -2
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/communities.html +8 -7
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/external_resources.html +5 -6
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/licenses.html +9 -13
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/manage_menu.html +8 -5
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/stats.html +2 -4
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/macros/detail.html +1 -1
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/macros/doi.html +7 -5
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/macros/files.html +21 -4
- invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/tombstone.html +6 -1
- invenio_app_rdm/records_ui/utils.py +93 -1
- invenio_app_rdm/records_ui/views/decorators.py +24 -14
- invenio_app_rdm/records_ui/views/deposits.py +100 -27
- invenio_app_rdm/records_ui/views/filters.py +11 -4
- invenio_app_rdm/records_ui/views/records.py +23 -13
- invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/file-modification/index.html +88 -0
- invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/guest-access-request/index.html +5 -5
- invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/record-deletion/index.html +95 -0
- invenio_app_rdm/requests_ui/views/requests.py +54 -87
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/auditLogs/ViewRecentChanges.js +8 -8
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/components/ImpersonateUserForm.js +12 -17
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/components/RevisionsDiffViewer.js +14 -16
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/components/SetQuotaAction.js +1 -1
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/records/api/routes.js +1 -2
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/requests/RequestsSearchResultItem.js +81 -0
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/requests/RequestsSearchbarLayout.js +48 -0
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/requests/index.js +22 -0
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/communityRecordsSearch/CommunityRecordsSearchAppLayout.js +3 -4
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/CopyButton.js +38 -19
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/FileModificationUntil.js +45 -0
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/RecordDeletion/DeletionModal.js +354 -0
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/RecordDeletion/DeletionRadioGroup.js +44 -0
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/RecordDeletion.js +81 -0
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/deposit/RDMDepositForm.js +55 -5
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/deposit/index.js +4 -1
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/CommunitiesManagement.js +2 -2
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/ExportDropdown.js +7 -2
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/ManageButton.js +52 -19
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordCitationField.js +15 -14
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordCommunitiesListModal/RecordCommunitiesListModal.js +4 -4
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordCommunitySubmission/RecordCommunitySubmissionModal.js +1 -1
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordManagement.js +17 -3
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordVersionsList.js +16 -17
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RemoveFromCommunity/RemoveFromCommunityAction.js +5 -5
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/index.js +42 -40
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/theme.js +9 -5
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/requests/timeline/AccessRequestTimelineEdit.js +5 -5
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/requests/timeline/AccessRequestTimelineRead.js +2 -2
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/search/components.js +14 -19
- invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/theme.js +9 -0
- invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/file_uploader/uppy.less +37 -0
- invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/landing_page/licenses.less +5 -3
- invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/globals/site.overrides +6 -1
- invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/modules/accordion.overrides +10 -1
- invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/modules/search.overrides +7 -0
- invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/modules/search.variables +0 -0
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/i18next.js +1 -1
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/_generatedTranslations.js +66 -0
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ar/messages.po +804 -137
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ar/translations.json +277 -249
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/bg/messages.po +689 -70
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/bg/translations.json +102 -82
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ca/messages.po +699 -80
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ca/translations.json +112 -92
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/cs/messages.po +821 -138
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/cs/translations.json +290 -262
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/da/messages.po +691 -66
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/da/translations.json +91 -71
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/de/messages.po +818 -138
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/de/translations.json +260 -240
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/el/messages.po +698 -78
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/el/translations.json +108 -88
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/en/messages.po +1000 -5
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/en/translations.json +81 -28
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/es/messages.po +810 -137
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/es/translations.json +253 -233
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/et/messages.po +746 -133
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/et/translations.json +130 -110
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/fa/messages.po +688 -69
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/fa/translations.json +103 -79
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/fr/messages.po +809 -126
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/fr/translations.json +277 -257
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/hr/messages.po +695 -70
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/hr/translations.json +101 -79
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/hu/messages.po +801 -135
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/hu/translations.json +254 -234
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/index.js +16 -65
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/it/messages.po +712 -86
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/it/translations.json +116 -96
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ja/messages.po +683 -70
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ja/translations.json +96 -78
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ka/messages.po +689 -70
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ka/translations.json +109 -85
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ko/messages.po +889 -0
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ko/translations.json +277 -0
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/lt/messages.po +702 -71
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/lt/translations.json +113 -85
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/no/messages.po +689 -70
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/no/translations.json +102 -82
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/pl/messages.po +704 -70
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/pl/translations.json +119 -91
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/pt/messages.po +694 -69
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/pt/translations.json +93 -73
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ro/messages.po +717 -85
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ro/translations.json +155 -133
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ru/messages.po +806 -124
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ru/translations.json +288 -260
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/sk/messages.po +713 -82
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/sk/translations.json +119 -91
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/sv/messages.po +807 -141
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/sv/translations.json +260 -240
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/tr/messages.po +799 -128
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/tr/translations.json +259 -239
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/uk/messages.po +756 -131
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/uk/translations.json +124 -96
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/zh_CN/messages.po +736 -123
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/zh_CN/translations.json +130 -108
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/zh_TW/messages.po +683 -70
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/zh_TW/translations.json +100 -78
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/package.json +3 -37
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/translations.pot +243 -94
- invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/help/search.de.html +2 -2
- invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/help/search.en.html +4 -4
- invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/help/search.sv.html +4 -4
- invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/intro_section.html +7 -6
- invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/macros/records_list.html +2 -1
- invenio_app_rdm/theme/templates/semantic-ui/invenio_communities/default_static_page.html +26 -0
- invenio_app_rdm/theme/webpack.py +3 -2
- invenio_app_rdm/translations/ar/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/ar/LC_MESSAGES/messages.po +972 -376
- invenio_app_rdm/translations/bg/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/bg/LC_MESSAGES/messages.po +907 -278
- invenio_app_rdm/translations/ca/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/ca/LC_MESSAGES/messages.po +912 -283
- invenio_app_rdm/translations/cs/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/cs/LC_MESSAGES/messages.po +1069 -405
- invenio_app_rdm/translations/da/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/da/LC_MESSAGES/messages.po +908 -273
- invenio_app_rdm/translations/de/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/de/LC_MESSAGES/messages.po +1017 -406
- invenio_app_rdm/translations/el/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/el/LC_MESSAGES/messages.po +915 -286
- invenio_app_rdm/translations/es/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/es/LC_MESSAGES/messages.po +963 -371
- invenio_app_rdm/translations/et/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/et/LC_MESSAGES/messages.po +938 -362
- invenio_app_rdm/translations/fa/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/fa/LC_MESSAGES/messages.po +906 -277
- invenio_app_rdm/translations/fr/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/fr/LC_MESSAGES/messages.po +1032 -375
- invenio_app_rdm/translations/hr/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/hr/LC_MESSAGES/messages.po +907 -278
- invenio_app_rdm/translations/hu/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/hu/LC_MESSAGES/messages.po +985 -369
- invenio_app_rdm/translations/it/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/it/LC_MESSAGES/messages.po +928 -298
- invenio_app_rdm/translations/ja/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/ja/LC_MESSAGES/messages.po +907 -278
- invenio_app_rdm/translations/ka/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/ka/LC_MESSAGES/messages.po +909 -280
- invenio_app_rdm/translations/ko/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/ko/LC_MESSAGES/messages.po +1361 -0
- invenio_app_rdm/translations/lt/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/lt/LC_MESSAGES/messages.po +910 -281
- invenio_app_rdm/translations/messages.pot +486 -303
- invenio_app_rdm/translations/no/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/no/LC_MESSAGES/messages.po +907 -278
- invenio_app_rdm/translations/pl/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/pl/LC_MESSAGES/messages.po +907 -278
- invenio_app_rdm/translations/pt/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/pt/LC_MESSAGES/messages.po +906 -277
- invenio_app_rdm/translations/ro/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/ro/LC_MESSAGES/messages.po +1042 -384
- invenio_app_rdm/translations/ru/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/ru/LC_MESSAGES/messages.po +1022 -370
- invenio_app_rdm/translations/sk/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/sk/LC_MESSAGES/messages.po +916 -287
- invenio_app_rdm/translations/sv/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/sv/LC_MESSAGES/messages.po +989 -380
- invenio_app_rdm/translations/tr/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/tr/LC_MESSAGES/messages.po +992 -341
- invenio_app_rdm/translations/uk/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/uk/LC_MESSAGES/messages.po +935 -356
- invenio_app_rdm/translations/zh_CN/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/zh_CN/LC_MESSAGES/messages.po +939 -347
- invenio_app_rdm/translations/zh_TW/LC_MESSAGES/messages.mo +0 -0
- invenio_app_rdm/translations/zh_TW/LC_MESSAGES/messages.po +907 -278
- invenio_app_rdm/upgrade_scripts/migrate_12_0_to_13_0.py +190 -62
- {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/METADATA +118 -7
- {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/RECORD +209 -225
- {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/entry_points.txt +2 -0
- {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/top_level.txt +0 -1
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/i18next-scanner.config.js +0 -64
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/package-lock.json +0 -1512
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/scripts/compileCatalog.js +0 -40
- invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/scripts/initCatalog.js +0 -20
- tests/__init__.py +0 -8
- tests/api/__init__.py +0 -8
- tests/api/conftest.py +0 -24
- tests/api/test_protect_files_rest.py +0 -73
- tests/api/test_record_api.py +0 -175
- tests/api/test_stats_api.py +0 -26
- tests/conftest.py +0 -390
- tests/fixtures/__init__.py +0 -8
- tests/fixtures/app_data/oai_sets.yaml +0 -3
- tests/fixtures/app_data/pages/about.html +0 -1
- tests/fixtures/app_data/pages.yaml +0 -4
- tests/fixtures/conftest.py +0 -27
- tests/fixtures/test_cli.py +0 -25
- tests/fixtures/test_fixtures.py +0 -46
- tests/mock_module/__init__.py +0 -7
- tests/mock_module/templates/mock_mail.html +0 -27
- tests/mock_module/views.py +0 -32
- tests/redirector/__init__.py +0 -8
- tests/redirector/conftest.py +0 -54
- tests/redirector/test_redirector.py +0 -28
- tests/test_tasks.py +0 -209
- tests/test_utils.py +0 -67
- tests/test_version.py +0 -16
- tests/test_views.py +0 -43
- tests/ui/__init__.py +0 -8
- tests/ui/conftest.py +0 -115
- tests/ui/test_deposits.py +0 -115
- tests/ui/test_export_formats.py +0 -37
- tests/ui/test_file_download.py +0 -73
- tests/ui/test_filters.py +0 -10
- tests/ui/test_robotstxt.py +0 -35
- tests/ui/test_signposting_ui.py +0 -95
- tests/ui/test_sitemaps.py +0 -85
- tests/ui/test_stats_ui.py +0 -92
- {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/WHEEL +0 -0
- {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/licenses/LICENSE +0 -0
tests/conftest.py
DELETED
|
@@ -1,390 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
#
|
|
3
|
-
# Copyright (C) 2019-2025 CERN.
|
|
4
|
-
# Copyright (C) 2019-2025 Northwestern University.
|
|
5
|
-
# Copyright (C) 2024-2025 Graz University of Technology.
|
|
6
|
-
#
|
|
7
|
-
# Invenio App RDM is free software; you can redistribute it and/or modify it
|
|
8
|
-
# under the terms of the MIT License; see LICENSE file for more details.
|
|
9
|
-
|
|
10
|
-
"""Common pytest fixtures and plugins."""
|
|
11
|
-
|
|
12
|
-
import copy
|
|
13
|
-
from collections import namedtuple
|
|
14
|
-
|
|
15
|
-
# Monkey patch Werkzeug 2.1
|
|
16
|
-
# Flask-Login uses the safe_str_cmp method which has been removed in Werkzeug
|
|
17
|
-
# 2.1. Flask-Login v0.6.0 (yet to be released at the time of writing) fixes the
|
|
18
|
-
# issue. Once we depend on Flask-Login v0.6.0 as the minimal version in
|
|
19
|
-
# Flask-Security-Invenio/Invenio-Accounts we can remove this patch again.
|
|
20
|
-
try:
|
|
21
|
-
# Werkzeug <2.1
|
|
22
|
-
from werkzeug import security
|
|
23
|
-
|
|
24
|
-
security.safe_str_cmp
|
|
25
|
-
except AttributeError:
|
|
26
|
-
# Werkzeug >=2.1
|
|
27
|
-
import hmac
|
|
28
|
-
|
|
29
|
-
from werkzeug import security
|
|
30
|
-
|
|
31
|
-
security.safe_str_cmp = hmac.compare_digest
|
|
32
|
-
|
|
33
|
-
import pytest
|
|
34
|
-
from flask_security import login_user
|
|
35
|
-
from flask_security.utils import hash_password
|
|
36
|
-
from invenio_access.models import ActionUsers
|
|
37
|
-
from invenio_access.permissions import system_identity
|
|
38
|
-
from invenio_access.proxies import current_access
|
|
39
|
-
from invenio_accounts.proxies import current_datastore
|
|
40
|
-
from invenio_accounts.testutils import login_user_via_session
|
|
41
|
-
from invenio_app.factory import create_app as _create_app
|
|
42
|
-
from invenio_db import db
|
|
43
|
-
from invenio_records_resources.proxies import current_service_registry
|
|
44
|
-
from invenio_vocabularies.contrib.subjects.api import Subject
|
|
45
|
-
from invenio_vocabularies.proxies import current_service as vocabulary_service
|
|
46
|
-
from invenio_vocabularies.records.api import Vocabulary
|
|
47
|
-
from invenio_vocabularies.records.models import VocabularyScheme
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
@pytest.fixture(scope="module")
|
|
51
|
-
def create_app(entry_points):
|
|
52
|
-
"""Creates a test app."""
|
|
53
|
-
return _create_app
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
@pytest.fixture(scope="module")
|
|
57
|
-
def app_config(app_config):
|
|
58
|
-
"""Override pytest-invenio app_config fixture to disable CSRF check."""
|
|
59
|
-
# Variable not used. We set it to silent warnings
|
|
60
|
-
app_config["REST_CSRF_ENABLED"] = False
|
|
61
|
-
|
|
62
|
-
return app_config
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
@pytest.fixture(scope="module")
|
|
66
|
-
def subjects_service(app):
|
|
67
|
-
"""Subjects service."""
|
|
68
|
-
return current_service_registry.get("subjects")
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
@pytest.fixture(scope="module")
|
|
72
|
-
def records_service(app):
|
|
73
|
-
"""Records service."""
|
|
74
|
-
return current_service_registry.get("records")
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
pytest_plugins = ("celery.contrib.pytest",)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
@pytest.fixture(scope="module")
|
|
81
|
-
def extra_entry_points():
|
|
82
|
-
"""Register extra entry point."""
|
|
83
|
-
return {
|
|
84
|
-
"invenio_base.blueprints": [
|
|
85
|
-
"mock_module = tests.mock_module.views:create_blueprint"
|
|
86
|
-
],
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
@pytest.fixture(scope="function")
|
|
91
|
-
def minimal_record(users):
|
|
92
|
-
"""Minimal record data as dict coming from the external world."""
|
|
93
|
-
return {
|
|
94
|
-
"access": {
|
|
95
|
-
"record": "public",
|
|
96
|
-
"files": "public",
|
|
97
|
-
},
|
|
98
|
-
"files": {"enabled": False}, # Most tests don't care about file upload
|
|
99
|
-
"metadata": {
|
|
100
|
-
"publication_date": "2020-06-01",
|
|
101
|
-
"resource_type": {
|
|
102
|
-
"id": "image-photo",
|
|
103
|
-
},
|
|
104
|
-
# Technically not required
|
|
105
|
-
"creators": [
|
|
106
|
-
{
|
|
107
|
-
"person_or_org": {
|
|
108
|
-
"type": "personal",
|
|
109
|
-
"name": "Doe, John",
|
|
110
|
-
"given_name": "John Doe",
|
|
111
|
-
"family_name": "Doe",
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
],
|
|
115
|
-
"title": "A Romans story",
|
|
116
|
-
},
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
@pytest.fixture()
|
|
121
|
-
def users(app, db):
|
|
122
|
-
"""Create users."""
|
|
123
|
-
password = "123456"
|
|
124
|
-
with db.session.begin_nested():
|
|
125
|
-
datastore = app.extensions["security"].datastore
|
|
126
|
-
# create users
|
|
127
|
-
hashed_password = hash_password(password)
|
|
128
|
-
user1 = datastore.create_user(
|
|
129
|
-
email="user1@test.com", password=hashed_password, active=True
|
|
130
|
-
)
|
|
131
|
-
user2 = datastore.create_user(
|
|
132
|
-
email="user2@test.com", password=hashed_password, active=True
|
|
133
|
-
)
|
|
134
|
-
# Give role to administration-access
|
|
135
|
-
db.session.add(ActionUsers(action="administration-access", user=user1))
|
|
136
|
-
db.session.commit()
|
|
137
|
-
return {
|
|
138
|
-
"user1": user1,
|
|
139
|
-
"user2": user2,
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
@pytest.fixture()
|
|
144
|
-
def roles(app, db):
|
|
145
|
-
"""Create some roles."""
|
|
146
|
-
with db.session.begin_nested():
|
|
147
|
-
datastore = app.extensions["security"].datastore
|
|
148
|
-
role1 = datastore.create_role(
|
|
149
|
-
name="administration", description="administration role"
|
|
150
|
-
)
|
|
151
|
-
role2 = datastore.create_role(name="test", description="tests are coming")
|
|
152
|
-
|
|
153
|
-
db.session.commit()
|
|
154
|
-
return {"administration": role1, "test": role2}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
@pytest.fixture()
|
|
158
|
-
def administration_user(users, roles):
|
|
159
|
-
"""Give administration rights to a user."""
|
|
160
|
-
user = users["user1"]
|
|
161
|
-
role = roles["administration"]
|
|
162
|
-
current_datastore.add_role_to_user(user, role)
|
|
163
|
-
action = current_access.actions["superuser-access"]
|
|
164
|
-
db.session.add(ActionUsers.allow(action, user_id=user.id))
|
|
165
|
-
|
|
166
|
-
return user
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
@pytest.fixture()
|
|
170
|
-
def client_with_login(client, users):
|
|
171
|
-
"""Log in a user to the client."""
|
|
172
|
-
user = users["user1"]
|
|
173
|
-
login_user(user, remember=True)
|
|
174
|
-
login_user_via_session(client, email=user.email)
|
|
175
|
-
return client
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
def create_vocabulary_type(id_, pid_type):
|
|
179
|
-
"""Create vocabulary type."""
|
|
180
|
-
vocabulary_service = current_service_registry.get("vocabularies")
|
|
181
|
-
return vocabulary_service.create_type(system_identity, id_, pid_type)
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
@pytest.fixture(scope="module")
|
|
185
|
-
def resource_type_type(app):
|
|
186
|
-
"""Resource type vocabulary type."""
|
|
187
|
-
return create_vocabulary_type("resourcetypes", "rsrct")
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
@pytest.fixture(scope="module")
|
|
191
|
-
def resource_type_item(app, resource_type_type):
|
|
192
|
-
"""Resource type vocabulary record."""
|
|
193
|
-
rst = vocabulary_service.create(
|
|
194
|
-
system_identity,
|
|
195
|
-
{
|
|
196
|
-
"id": "image-photo",
|
|
197
|
-
"icon": "chart bar outline",
|
|
198
|
-
"props": {
|
|
199
|
-
"csl": "graphic",
|
|
200
|
-
"datacite_general": "Image",
|
|
201
|
-
"datacite_type": "Photo",
|
|
202
|
-
"eurepo": "info:eu-repo/semantic/image-photo",
|
|
203
|
-
"openaire_resourceType": "25",
|
|
204
|
-
"openaire_type": "dataset",
|
|
205
|
-
"schema.org": "https://schema.org/Photograph",
|
|
206
|
-
"subtype": "image-photo",
|
|
207
|
-
"type": "image",
|
|
208
|
-
},
|
|
209
|
-
"title": {"en": "Photo"},
|
|
210
|
-
"tags": ["depositable", "linkable"],
|
|
211
|
-
"type": "resourcetypes",
|
|
212
|
-
},
|
|
213
|
-
)
|
|
214
|
-
|
|
215
|
-
Vocabulary.index.refresh()
|
|
216
|
-
|
|
217
|
-
return rst
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
@pytest.fixture(scope="module")
|
|
221
|
-
def languages_type(app):
|
|
222
|
-
"""Language vocabulary type."""
|
|
223
|
-
return create_vocabulary_type("languages", "lng")
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
@pytest.fixture(scope="module")
|
|
227
|
-
def language_item(app, languages_type):
|
|
228
|
-
"""Language vocabulary record."""
|
|
229
|
-
lang = vocabulary_service.create(
|
|
230
|
-
system_identity,
|
|
231
|
-
{
|
|
232
|
-
"id": "eng",
|
|
233
|
-
"props": {
|
|
234
|
-
"alpha_2": "",
|
|
235
|
-
},
|
|
236
|
-
"title": {"en": "English"},
|
|
237
|
-
"type": "languages",
|
|
238
|
-
},
|
|
239
|
-
)
|
|
240
|
-
|
|
241
|
-
Vocabulary.index.refresh()
|
|
242
|
-
|
|
243
|
-
return lang
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
@pytest.fixture
|
|
247
|
-
def subjects_mesh_scheme(app, db):
|
|
248
|
-
"""Subject Scheme for MeSH."""
|
|
249
|
-
scheme = VocabularyScheme.create(
|
|
250
|
-
id="MeSH",
|
|
251
|
-
parent_id="subjects",
|
|
252
|
-
name="Medical Subject Headings",
|
|
253
|
-
uri="https://www.nlm.nih.gov/mesh/meshhome.html",
|
|
254
|
-
)
|
|
255
|
-
db.session.commit()
|
|
256
|
-
return scheme
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
@pytest.fixture
|
|
260
|
-
def subject_item(app, subjects_mesh_scheme, subjects_service):
|
|
261
|
-
"""Subject vocabulary record."""
|
|
262
|
-
subj = subjects_service.create(
|
|
263
|
-
system_identity,
|
|
264
|
-
{
|
|
265
|
-
"id": "https://id.nlm.nih.gov/mesh/D000015",
|
|
266
|
-
"scheme": "MeSH",
|
|
267
|
-
"subject": "Abnormalities, Multiple",
|
|
268
|
-
},
|
|
269
|
-
)
|
|
270
|
-
|
|
271
|
-
Subject.index.refresh()
|
|
272
|
-
|
|
273
|
-
return subj
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
@pytest.fixture(scope="module")
|
|
277
|
-
def communitytypes_type(app):
|
|
278
|
-
"""Creates and retrieves a vocabulary type."""
|
|
279
|
-
return create_vocabulary_type("communitytypes", "comtyp")
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
@pytest.fixture(scope="module")
|
|
283
|
-
def communitytypes(communitytypes_type):
|
|
284
|
-
"""Community types."""
|
|
285
|
-
vocabulary_service = current_service_registry.get("vocabularies")
|
|
286
|
-
type_dicts = [
|
|
287
|
-
{"id": "organization", "title": {"en": "Organization"}},
|
|
288
|
-
{"id": "event", "title": {"en": "Event"}},
|
|
289
|
-
{"id": "topic", "title": {"en": "Topic"}},
|
|
290
|
-
{"id": "project", "title": {"en": "Project"}},
|
|
291
|
-
]
|
|
292
|
-
[t.update({"type": "communitytypes"}) for t in type_dicts]
|
|
293
|
-
types = [
|
|
294
|
-
vocabulary_service.create(identity=system_identity, data=t) for t in type_dicts
|
|
295
|
-
]
|
|
296
|
-
vocabulary_service.indexer.refresh()
|
|
297
|
-
return types
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
@pytest.fixture()
|
|
301
|
-
def community_input():
|
|
302
|
-
"""Community input dict."""
|
|
303
|
-
return {
|
|
304
|
-
"access": {
|
|
305
|
-
"visibility": "public",
|
|
306
|
-
"member_policy": "open",
|
|
307
|
-
"record_policy": "open",
|
|
308
|
-
},
|
|
309
|
-
"slug": "my_community_id",
|
|
310
|
-
"metadata": {
|
|
311
|
-
"title": "My Community",
|
|
312
|
-
# "description": "This is an example Community.",
|
|
313
|
-
"type": {"id": "event"},
|
|
314
|
-
# "curation_policy": "This is the kind of records we accept.",
|
|
315
|
-
# "website": "https://inveniosoftware.org/",
|
|
316
|
-
},
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
RunningApp = namedtuple(
|
|
321
|
-
"RunningApp",
|
|
322
|
-
[
|
|
323
|
-
"app",
|
|
324
|
-
"location",
|
|
325
|
-
"resource_type_item",
|
|
326
|
-
"language_item",
|
|
327
|
-
"subject_item",
|
|
328
|
-
"communitytypes",
|
|
329
|
-
],
|
|
330
|
-
)
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
@pytest.fixture
|
|
334
|
-
def running_app(
|
|
335
|
-
app, location, resource_type_item, language_item, subject_item, communitytypes
|
|
336
|
-
):
|
|
337
|
-
"""Fixture mimicking a running app."""
|
|
338
|
-
return RunningApp(
|
|
339
|
-
app, location, resource_type_item, language_item, subject_item, communitytypes
|
|
340
|
-
)
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
@pytest.fixture()
|
|
344
|
-
def create_record(running_app, minimal_record, records_service):
|
|
345
|
-
"""Record creation and publication function fixture."""
|
|
346
|
-
files_service = records_service.draft_files
|
|
347
|
-
|
|
348
|
-
def _create_record(identity=None, data=minimal_record, files=None):
|
|
349
|
-
"""Create and publish an RDMRecord.
|
|
350
|
-
|
|
351
|
-
Optionally assign it files.
|
|
352
|
-
"""
|
|
353
|
-
idty = identity or system_identity
|
|
354
|
-
data_copy = copy.deepcopy(data)
|
|
355
|
-
if files:
|
|
356
|
-
data_copy["files"] = {"enabled": True}
|
|
357
|
-
|
|
358
|
-
draft_data = records_service.create(idty, data_copy)._record
|
|
359
|
-
pid_value_of_draft = draft_data.pid.pid_value
|
|
360
|
-
if files:
|
|
361
|
-
files_service.init_files(idty, pid_value_of_draft, [f.data for f in files])
|
|
362
|
-
for f in files:
|
|
363
|
-
files_service.set_file_content(
|
|
364
|
-
idty,
|
|
365
|
-
id_=pid_value_of_draft,
|
|
366
|
-
file_key=f.data["key"],
|
|
367
|
-
stream=f.content,
|
|
368
|
-
content_length=f.content.getbuffer().nbytes,
|
|
369
|
-
)
|
|
370
|
-
files_service.commit_file(
|
|
371
|
-
idty, id_=pid_value_of_draft, file_key=f.data["key"]
|
|
372
|
-
)
|
|
373
|
-
|
|
374
|
-
record_result = records_service.publish(idty, id_=pid_value_of_draft)
|
|
375
|
-
return record_result
|
|
376
|
-
|
|
377
|
-
return _create_record
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
@pytest.fixture()
|
|
381
|
-
def create_community(running_app, community_input):
|
|
382
|
-
"""Community creation function fixture."""
|
|
383
|
-
community_service = current_service_registry.get("communities")
|
|
384
|
-
|
|
385
|
-
def _create_community(identity=None, data=community_input):
|
|
386
|
-
"""Create a community."""
|
|
387
|
-
idty = identity or system_identity
|
|
388
|
-
return community_service.create(idty, data)
|
|
389
|
-
|
|
390
|
-
return _create_community
|
tests/fixtures/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
About page
|
tests/fixtures/conftest.py
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
#
|
|
3
|
-
# Copyright (C) 2022 CERN.
|
|
4
|
-
#
|
|
5
|
-
# Invenio App RDM is free software; you can redistribute it and/or modify it
|
|
6
|
-
# under the terms of the MIT License; see LICENSE file for more details.
|
|
7
|
-
|
|
8
|
-
"""Test fixtures for application vocabulary fixtures."""
|
|
9
|
-
|
|
10
|
-
import pytest
|
|
11
|
-
from invenio_app.factory import create_api
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@pytest.fixture(scope="module")
|
|
15
|
-
def create_app():
|
|
16
|
-
"""Application factory fixture."""
|
|
17
|
-
return create_api
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
@pytest.fixture(scope="module")
|
|
21
|
-
def cli_runner(base_app):
|
|
22
|
-
"""Create a CLI runner for testing a CLI command."""
|
|
23
|
-
|
|
24
|
-
def cli_invoke(command, *args, input=None):
|
|
25
|
-
return base_app.test_cli_runner().invoke(command, args, input=input)
|
|
26
|
-
|
|
27
|
-
return cli_invoke
|
tests/fixtures/test_cli.py
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
#
|
|
3
|
-
# Copyright (C) 2022 CERN.
|
|
4
|
-
#
|
|
5
|
-
# Invenio App RDM is free software; you can redistribute it and/or modify
|
|
6
|
-
# it under the terms of the MIT License; see LICENSE file for more details.
|
|
7
|
-
|
|
8
|
-
"""Tests for the CLI."""
|
|
9
|
-
|
|
10
|
-
from invenio_access.permissions import system_identity
|
|
11
|
-
from invenio_rdm_records.proxies import current_oaipmh_server_service
|
|
12
|
-
|
|
13
|
-
from invenio_app_rdm.cli import create_fixtures
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
def test_create_fixtures(app, db, cli_runner):
|
|
17
|
-
"""Assert that fixtures are created."""
|
|
18
|
-
result = cli_runner(create_fixtures)
|
|
19
|
-
assert result.exit_code == 0
|
|
20
|
-
|
|
21
|
-
service = current_oaipmh_server_service
|
|
22
|
-
res_set = service.search(system_identity, params={"q": f"%"})
|
|
23
|
-
|
|
24
|
-
# oai_sets.yaml file left empty
|
|
25
|
-
assert res_set.total == 2
|
tests/fixtures/test_fixtures.py
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
#
|
|
3
|
-
# Copyright (C) 2022 CERN.
|
|
4
|
-
#
|
|
5
|
-
# Invenio App RDM is free software; you can redistribute it and/or modify
|
|
6
|
-
# it under the terms of the MIT License; see LICENSE file for more details.
|
|
7
|
-
|
|
8
|
-
from pathlib import Path
|
|
9
|
-
|
|
10
|
-
from invenio_access.permissions import system_identity
|
|
11
|
-
from invenio_pages.proxies import current_pages_service
|
|
12
|
-
from invenio_rdm_records.proxies import current_oaipmh_server_service
|
|
13
|
-
|
|
14
|
-
from invenio_app_rdm.fixtures import StaticPages
|
|
15
|
-
from invenio_app_rdm.fixtures.oai_sets import OAICustomSets
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
def test_load_oai_sets(app):
|
|
19
|
-
dir_ = Path(__file__).parent
|
|
20
|
-
service = current_oaipmh_server_service
|
|
21
|
-
oai_sets = OAICustomSets(
|
|
22
|
-
[dir_ / "app_data", dir_.parent.parent / "invenio_app_rdm/fixtures/data"],
|
|
23
|
-
"oai_sets.yaml",
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
oai_sets.load()
|
|
27
|
-
|
|
28
|
-
res_set = service.search(system_identity, params={"q": f"set1"})
|
|
29
|
-
|
|
30
|
-
assert res_set.total == 1
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
def test_load_pages(app):
|
|
34
|
-
dir_ = Path(__file__).parent
|
|
35
|
-
StaticPages(
|
|
36
|
-
[dir_ / "app_data", dir_.parent.parent / "invenio_app_rdm/fixtures/data"],
|
|
37
|
-
"pages.yaml",
|
|
38
|
-
[dir_ / "app_data/pages", dir_ / "pages"],
|
|
39
|
-
force=True,
|
|
40
|
-
).load()
|
|
41
|
-
|
|
42
|
-
pages = current_pages_service.search(system_identity)
|
|
43
|
-
|
|
44
|
-
assert pages.total == 1
|
|
45
|
-
|
|
46
|
-
assert pages.to_dict()["hits"]["hits"][0]["title"] == "About"
|
tests/mock_module/__init__.py
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{#
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
|
-
#
|
|
4
|
-
# Copyright (C) 2022 CERN.
|
|
5
|
-
# Copyright (C) 2025 Northwestern University.
|
|
6
|
-
#
|
|
7
|
-
# Invenio App RDM is free software; you can redistribute it and/or modify it
|
|
8
|
-
# under the terms of the MIT License; see LICENSE file for more details.
|
|
9
|
-
-#}
|
|
10
|
-
|
|
11
|
-
{%- for entry in entries -%}
|
|
12
|
-
{{ "ID: %s" | format(entry.file.id) }}
|
|
13
|
-
{{ "URI: %s" | format(entry.file.uri) }}
|
|
14
|
-
{%- if 'filename' in entry %}
|
|
15
|
-
{{ "Name: %s" | format(entry.filename) }}
|
|
16
|
-
{%- endif %}
|
|
17
|
-
{{ "Created: %s" | format(entry.file.created) }}
|
|
18
|
-
{{ "Checksum: %s" | format(entry.file.checksum) }}
|
|
19
|
-
{{ "Last check: %s" | format(entry.file.last_check_at) }}
|
|
20
|
-
{%- if 'record' in entry %}
|
|
21
|
-
{{ "Record: %s" | format(invenio_url_for("invenio_app_rdm_records.record_detail", pid_value=entry.record.id)) }}
|
|
22
|
-
{%- endif %}
|
|
23
|
-
{%- if 'draft' in entry %}
|
|
24
|
-
{{ "Draft: %s" | format(invenio_url_for("invenio_app_rdm_records.deposit_edit", pid_value=entry.draft.id)) }}
|
|
25
|
-
{%- endif %}
|
|
26
|
-
{{ "-" * 80 }}
|
|
27
|
-
{% endfor %}
|
tests/mock_module/views.py
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
#
|
|
3
|
-
# Copyright (C) 2022 CERN.
|
|
4
|
-
#
|
|
5
|
-
# Invenio App RDM is free software; you can redistribute it and/or modify it
|
|
6
|
-
# under the terms of the MIT License; see LICENSE file for more details.
|
|
7
|
-
"""Mock module blueprint."""
|
|
8
|
-
|
|
9
|
-
from flask import Blueprint
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
def create_blueprint(app):
|
|
13
|
-
"""Creates a blueprint for mock module and registers a mock url rule."""
|
|
14
|
-
blueprint = Blueprint(
|
|
15
|
-
"app_rdm_mock_module",
|
|
16
|
-
__name__,
|
|
17
|
-
template_folder="templates",
|
|
18
|
-
static_folder="static",
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
blueprint.add_url_rule(
|
|
22
|
-
"/test_app_rdm/mock",
|
|
23
|
-
endpoint="test_app_rdm_mock_endpoint",
|
|
24
|
-
view_func=mock_view_func,
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
return blueprint
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def mock_view_func(mock_arg):
|
|
31
|
-
"""Mock view function."""
|
|
32
|
-
return mock_arg
|
tests/redirector/__init__.py
DELETED
tests/redirector/conftest.py
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
#
|
|
3
|
-
# Copyright (C) 2022 CERN.
|
|
4
|
-
#
|
|
5
|
-
# Invenio App RDM is free software; you can redistribute it and/or modify it
|
|
6
|
-
# under the terms of the MIT License; see LICENSE file for more details.
|
|
7
|
-
"""Redirector test fixtures."""
|
|
8
|
-
|
|
9
|
-
import pytest
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@pytest.fixture(scope="module")
|
|
13
|
-
def app_config(app_config, redirection_rules):
|
|
14
|
-
"""Override pytest-invenio app_config fixture to disable CSRF check."""
|
|
15
|
-
app_config["REDIRECTOR_RULES"] = redirection_rules
|
|
16
|
-
|
|
17
|
-
return app_config
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
@pytest.fixture(scope="module")
|
|
21
|
-
def redirection_rules():
|
|
22
|
-
"""Creates a dictionary of redirection rules."""
|
|
23
|
-
|
|
24
|
-
def internal_view_function_str():
|
|
25
|
-
"""Generates a redirection url to a mock endpoint."""
|
|
26
|
-
from flask import request, url_for
|
|
27
|
-
|
|
28
|
-
values = request.view_args
|
|
29
|
-
_type = values["type"]
|
|
30
|
-
values["mock_arg"] = _type
|
|
31
|
-
target = url_for("app_rdm_mock_module.test_app_rdm_mock_endpoint", **values)
|
|
32
|
-
return target
|
|
33
|
-
|
|
34
|
-
def internal_view_function_str():
|
|
35
|
-
"""Generates a redirection tuple(url, code) to a mock endpoint."""
|
|
36
|
-
from flask import request, url_for
|
|
37
|
-
|
|
38
|
-
values = request.view_args
|
|
39
|
-
_type = values["type"]
|
|
40
|
-
values["mock_arg"] = _type
|
|
41
|
-
target = url_for("app_rdm_mock_module.test_app_rdm_mock_endpoint", **values)
|
|
42
|
-
return (target, 302)
|
|
43
|
-
|
|
44
|
-
rules = {
|
|
45
|
-
"test_redirector_endpoint_external": {
|
|
46
|
-
"source": "/test/redirect_external",
|
|
47
|
-
"target": "https://cern.ch/",
|
|
48
|
-
},
|
|
49
|
-
"test_redirector_endpoint_internal": {
|
|
50
|
-
"source": "/test/redirect_internal/<type>",
|
|
51
|
-
"target": internal_view_function_str,
|
|
52
|
-
},
|
|
53
|
-
}
|
|
54
|
-
return rules
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
#
|
|
3
|
-
# Copyright (C) 2022 CERN.
|
|
4
|
-
#
|
|
5
|
-
# Invenio App RDM is free software; you can redistribute it and/or modify it
|
|
6
|
-
# under the terms of the MIT License; see LICENSE file for more details.
|
|
7
|
-
"""Redirector tests."""
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def test_redirector(client_with_login, redirection_rules):
|
|
11
|
-
"""Tests redirector resource."""
|
|
12
|
-
client = client_with_login
|
|
13
|
-
for endpoint, rule in redirection_rules.items():
|
|
14
|
-
source = rule["source"]
|
|
15
|
-
target = rule["target"]
|
|
16
|
-
response = client.get(source)
|
|
17
|
-
expected_url = target
|
|
18
|
-
expected_code = 301
|
|
19
|
-
# Target can be either a url or a function that returns a tuple(url, code)
|
|
20
|
-
if callable(target):
|
|
21
|
-
target_output = target()
|
|
22
|
-
if type(target_output) == tuple:
|
|
23
|
-
expected_url, expected_code = target_output
|
|
24
|
-
else:
|
|
25
|
-
expected_url = target_output
|
|
26
|
-
|
|
27
|
-
assert response.status_code == expected_code
|
|
28
|
-
assert response.headers["location"] == expected_url
|