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.
Files changed (247) hide show
  1. invenio_app_rdm/__init__.py +1 -1
  2. invenio_app_rdm/administration/moderation/__init__.py +11 -0
  3. invenio_app_rdm/administration/moderation/requests.py +175 -0
  4. invenio_app_rdm/administration/records/records.py +9 -7
  5. invenio_app_rdm/administration/templates/semantic-ui/invenio_app_rdm/administration/requests.html +14 -0
  6. invenio_app_rdm/administration/templates/semantic-ui/invenio_app_rdm/administration/requests_details.html +91 -0
  7. invenio_app_rdm/administration/user_moderation/user_moderation.py +4 -4
  8. invenio_app_rdm/administration/users/users.py +0 -5
  9. invenio_app_rdm/communities_ui/views/communities.py +9 -5
  10. invenio_app_rdm/config.py +73 -4
  11. invenio_app_rdm/ext.py +2 -2
  12. invenio_app_rdm/fixtures/pages.py +5 -2
  13. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/deposit.html +11 -0
  14. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/detail.html +2 -5
  15. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/citation.html +2 -2
  16. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/details.html +2 -2
  17. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/communities.html +8 -7
  18. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/external_resources.html +5 -6
  19. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/licenses.html +9 -13
  20. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/side_bar/manage_menu.html +8 -5
  21. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/details/stats.html +2 -4
  22. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/macros/detail.html +1 -1
  23. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/macros/doi.html +7 -5
  24. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/macros/files.html +21 -4
  25. invenio_app_rdm/records_ui/templates/semantic-ui/invenio_app_rdm/records/tombstone.html +6 -1
  26. invenio_app_rdm/records_ui/utils.py +93 -1
  27. invenio_app_rdm/records_ui/views/decorators.py +24 -14
  28. invenio_app_rdm/records_ui/views/deposits.py +100 -27
  29. invenio_app_rdm/records_ui/views/filters.py +11 -4
  30. invenio_app_rdm/records_ui/views/records.py +23 -13
  31. invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/file-modification/index.html +88 -0
  32. invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/guest-access-request/index.html +5 -5
  33. invenio_app_rdm/requests_ui/templates/semantic-ui/invenio_requests/record-deletion/index.html +95 -0
  34. invenio_app_rdm/requests_ui/views/requests.py +54 -87
  35. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/auditLogs/ViewRecentChanges.js +8 -8
  36. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/components/ImpersonateUserForm.js +12 -17
  37. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/components/RevisionsDiffViewer.js +14 -16
  38. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/components/SetQuotaAction.js +1 -1
  39. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/records/api/routes.js +1 -2
  40. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/requests/RequestsSearchResultItem.js +81 -0
  41. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/requests/RequestsSearchbarLayout.js +48 -0
  42. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/administration/requests/index.js +22 -0
  43. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/communityRecordsSearch/CommunityRecordsSearchAppLayout.js +3 -4
  44. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/CopyButton.js +38 -19
  45. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/FileModificationUntil.js +45 -0
  46. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/RecordDeletion/DeletionModal.js +354 -0
  47. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/RecordDeletion/DeletionRadioGroup.js +44 -0
  48. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/components/RecordDeletion.js +81 -0
  49. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/deposit/RDMDepositForm.js +55 -5
  50. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/deposit/index.js +4 -1
  51. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/CommunitiesManagement.js +2 -2
  52. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/ExportDropdown.js +7 -2
  53. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/ManageButton.js +52 -19
  54. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordCitationField.js +15 -14
  55. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordCommunitiesListModal/RecordCommunitiesListModal.js +4 -4
  56. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordCommunitySubmission/RecordCommunitySubmissionModal.js +1 -1
  57. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordManagement.js +17 -3
  58. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RecordVersionsList.js +16 -17
  59. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/RemoveFromCommunity/RemoveFromCommunityAction.js +5 -5
  60. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/index.js +42 -40
  61. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/landing_page/theme.js +9 -5
  62. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/requests/timeline/AccessRequestTimelineEdit.js +5 -5
  63. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/requests/timeline/AccessRequestTimelineRead.js +2 -2
  64. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/search/components.js +14 -19
  65. invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/theme.js +9 -0
  66. invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/file_uploader/uppy.less +37 -0
  67. invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/landing_page/licenses.less +5 -3
  68. invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/globals/site.overrides +6 -1
  69. invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/modules/accordion.overrides +10 -1
  70. invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/modules/search.overrides +7 -0
  71. invenio_app_rdm/theme/assets/semantic-ui/less/invenio_app_rdm/theme/modules/search.variables +0 -0
  72. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/i18next.js +1 -1
  73. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/_generatedTranslations.js +66 -0
  74. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ar/messages.po +804 -137
  75. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ar/translations.json +277 -249
  76. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/bg/messages.po +689 -70
  77. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/bg/translations.json +102 -82
  78. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ca/messages.po +699 -80
  79. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ca/translations.json +112 -92
  80. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/cs/messages.po +821 -138
  81. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/cs/translations.json +290 -262
  82. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/da/messages.po +691 -66
  83. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/da/translations.json +91 -71
  84. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/de/messages.po +818 -138
  85. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/de/translations.json +260 -240
  86. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/el/messages.po +698 -78
  87. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/el/translations.json +108 -88
  88. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/en/messages.po +1000 -5
  89. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/en/translations.json +81 -28
  90. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/es/messages.po +810 -137
  91. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/es/translations.json +253 -233
  92. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/et/messages.po +746 -133
  93. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/et/translations.json +130 -110
  94. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/fa/messages.po +688 -69
  95. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/fa/translations.json +103 -79
  96. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/fr/messages.po +809 -126
  97. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/fr/translations.json +277 -257
  98. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/hr/messages.po +695 -70
  99. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/hr/translations.json +101 -79
  100. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/hu/messages.po +801 -135
  101. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/hu/translations.json +254 -234
  102. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/index.js +16 -65
  103. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/it/messages.po +712 -86
  104. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/it/translations.json +116 -96
  105. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ja/messages.po +683 -70
  106. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ja/translations.json +96 -78
  107. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ka/messages.po +689 -70
  108. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ka/translations.json +109 -85
  109. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ko/messages.po +889 -0
  110. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ko/translations.json +277 -0
  111. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/lt/messages.po +702 -71
  112. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/lt/translations.json +113 -85
  113. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/no/messages.po +689 -70
  114. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/no/translations.json +102 -82
  115. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/pl/messages.po +704 -70
  116. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/pl/translations.json +119 -91
  117. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/pt/messages.po +694 -69
  118. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/pt/translations.json +93 -73
  119. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ro/messages.po +717 -85
  120. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ro/translations.json +155 -133
  121. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ru/messages.po +806 -124
  122. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/ru/translations.json +288 -260
  123. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/sk/messages.po +713 -82
  124. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/sk/translations.json +119 -91
  125. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/sv/messages.po +807 -141
  126. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/sv/translations.json +260 -240
  127. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/tr/messages.po +799 -128
  128. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/tr/translations.json +259 -239
  129. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/uk/messages.po +756 -131
  130. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/uk/translations.json +124 -96
  131. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/zh_CN/messages.po +736 -123
  132. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/zh_CN/translations.json +130 -108
  133. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/zh_TW/messages.po +683 -70
  134. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/messages/zh_TW/translations.json +100 -78
  135. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/package.json +3 -37
  136. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/translations.pot +243 -94
  137. invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/help/search.de.html +2 -2
  138. invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/help/search.en.html +4 -4
  139. invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/help/search.sv.html +4 -4
  140. invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/intro_section.html +7 -6
  141. invenio_app_rdm/theme/templates/semantic-ui/invenio_app_rdm/macros/records_list.html +2 -1
  142. invenio_app_rdm/theme/templates/semantic-ui/invenio_communities/default_static_page.html +26 -0
  143. invenio_app_rdm/theme/webpack.py +3 -2
  144. invenio_app_rdm/translations/ar/LC_MESSAGES/messages.mo +0 -0
  145. invenio_app_rdm/translations/ar/LC_MESSAGES/messages.po +972 -376
  146. invenio_app_rdm/translations/bg/LC_MESSAGES/messages.mo +0 -0
  147. invenio_app_rdm/translations/bg/LC_MESSAGES/messages.po +907 -278
  148. invenio_app_rdm/translations/ca/LC_MESSAGES/messages.mo +0 -0
  149. invenio_app_rdm/translations/ca/LC_MESSAGES/messages.po +912 -283
  150. invenio_app_rdm/translations/cs/LC_MESSAGES/messages.mo +0 -0
  151. invenio_app_rdm/translations/cs/LC_MESSAGES/messages.po +1069 -405
  152. invenio_app_rdm/translations/da/LC_MESSAGES/messages.mo +0 -0
  153. invenio_app_rdm/translations/da/LC_MESSAGES/messages.po +908 -273
  154. invenio_app_rdm/translations/de/LC_MESSAGES/messages.mo +0 -0
  155. invenio_app_rdm/translations/de/LC_MESSAGES/messages.po +1017 -406
  156. invenio_app_rdm/translations/el/LC_MESSAGES/messages.mo +0 -0
  157. invenio_app_rdm/translations/el/LC_MESSAGES/messages.po +915 -286
  158. invenio_app_rdm/translations/es/LC_MESSAGES/messages.mo +0 -0
  159. invenio_app_rdm/translations/es/LC_MESSAGES/messages.po +963 -371
  160. invenio_app_rdm/translations/et/LC_MESSAGES/messages.mo +0 -0
  161. invenio_app_rdm/translations/et/LC_MESSAGES/messages.po +938 -362
  162. invenio_app_rdm/translations/fa/LC_MESSAGES/messages.mo +0 -0
  163. invenio_app_rdm/translations/fa/LC_MESSAGES/messages.po +906 -277
  164. invenio_app_rdm/translations/fr/LC_MESSAGES/messages.mo +0 -0
  165. invenio_app_rdm/translations/fr/LC_MESSAGES/messages.po +1032 -375
  166. invenio_app_rdm/translations/hr/LC_MESSAGES/messages.mo +0 -0
  167. invenio_app_rdm/translations/hr/LC_MESSAGES/messages.po +907 -278
  168. invenio_app_rdm/translations/hu/LC_MESSAGES/messages.mo +0 -0
  169. invenio_app_rdm/translations/hu/LC_MESSAGES/messages.po +985 -369
  170. invenio_app_rdm/translations/it/LC_MESSAGES/messages.mo +0 -0
  171. invenio_app_rdm/translations/it/LC_MESSAGES/messages.po +928 -298
  172. invenio_app_rdm/translations/ja/LC_MESSAGES/messages.mo +0 -0
  173. invenio_app_rdm/translations/ja/LC_MESSAGES/messages.po +907 -278
  174. invenio_app_rdm/translations/ka/LC_MESSAGES/messages.mo +0 -0
  175. invenio_app_rdm/translations/ka/LC_MESSAGES/messages.po +909 -280
  176. invenio_app_rdm/translations/ko/LC_MESSAGES/messages.mo +0 -0
  177. invenio_app_rdm/translations/ko/LC_MESSAGES/messages.po +1361 -0
  178. invenio_app_rdm/translations/lt/LC_MESSAGES/messages.mo +0 -0
  179. invenio_app_rdm/translations/lt/LC_MESSAGES/messages.po +910 -281
  180. invenio_app_rdm/translations/messages.pot +486 -303
  181. invenio_app_rdm/translations/no/LC_MESSAGES/messages.mo +0 -0
  182. invenio_app_rdm/translations/no/LC_MESSAGES/messages.po +907 -278
  183. invenio_app_rdm/translations/pl/LC_MESSAGES/messages.mo +0 -0
  184. invenio_app_rdm/translations/pl/LC_MESSAGES/messages.po +907 -278
  185. invenio_app_rdm/translations/pt/LC_MESSAGES/messages.mo +0 -0
  186. invenio_app_rdm/translations/pt/LC_MESSAGES/messages.po +906 -277
  187. invenio_app_rdm/translations/ro/LC_MESSAGES/messages.mo +0 -0
  188. invenio_app_rdm/translations/ro/LC_MESSAGES/messages.po +1042 -384
  189. invenio_app_rdm/translations/ru/LC_MESSAGES/messages.mo +0 -0
  190. invenio_app_rdm/translations/ru/LC_MESSAGES/messages.po +1022 -370
  191. invenio_app_rdm/translations/sk/LC_MESSAGES/messages.mo +0 -0
  192. invenio_app_rdm/translations/sk/LC_MESSAGES/messages.po +916 -287
  193. invenio_app_rdm/translations/sv/LC_MESSAGES/messages.mo +0 -0
  194. invenio_app_rdm/translations/sv/LC_MESSAGES/messages.po +989 -380
  195. invenio_app_rdm/translations/tr/LC_MESSAGES/messages.mo +0 -0
  196. invenio_app_rdm/translations/tr/LC_MESSAGES/messages.po +992 -341
  197. invenio_app_rdm/translations/uk/LC_MESSAGES/messages.mo +0 -0
  198. invenio_app_rdm/translations/uk/LC_MESSAGES/messages.po +935 -356
  199. invenio_app_rdm/translations/zh_CN/LC_MESSAGES/messages.mo +0 -0
  200. invenio_app_rdm/translations/zh_CN/LC_MESSAGES/messages.po +939 -347
  201. invenio_app_rdm/translations/zh_TW/LC_MESSAGES/messages.mo +0 -0
  202. invenio_app_rdm/translations/zh_TW/LC_MESSAGES/messages.po +907 -278
  203. invenio_app_rdm/upgrade_scripts/migrate_12_0_to_13_0.py +190 -62
  204. {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/METADATA +118 -7
  205. {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/RECORD +209 -225
  206. {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/entry_points.txt +2 -0
  207. {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/top_level.txt +0 -1
  208. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/i18next-scanner.config.js +0 -64
  209. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/package-lock.json +0 -1512
  210. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/scripts/compileCatalog.js +0 -40
  211. invenio_app_rdm/theme/assets/semantic-ui/translations/invenio_app_rdm/scripts/initCatalog.js +0 -20
  212. tests/__init__.py +0 -8
  213. tests/api/__init__.py +0 -8
  214. tests/api/conftest.py +0 -24
  215. tests/api/test_protect_files_rest.py +0 -73
  216. tests/api/test_record_api.py +0 -175
  217. tests/api/test_stats_api.py +0 -26
  218. tests/conftest.py +0 -390
  219. tests/fixtures/__init__.py +0 -8
  220. tests/fixtures/app_data/oai_sets.yaml +0 -3
  221. tests/fixtures/app_data/pages/about.html +0 -1
  222. tests/fixtures/app_data/pages.yaml +0 -4
  223. tests/fixtures/conftest.py +0 -27
  224. tests/fixtures/test_cli.py +0 -25
  225. tests/fixtures/test_fixtures.py +0 -46
  226. tests/mock_module/__init__.py +0 -7
  227. tests/mock_module/templates/mock_mail.html +0 -27
  228. tests/mock_module/views.py +0 -32
  229. tests/redirector/__init__.py +0 -8
  230. tests/redirector/conftest.py +0 -54
  231. tests/redirector/test_redirector.py +0 -28
  232. tests/test_tasks.py +0 -209
  233. tests/test_utils.py +0 -67
  234. tests/test_version.py +0 -16
  235. tests/test_views.py +0 -43
  236. tests/ui/__init__.py +0 -8
  237. tests/ui/conftest.py +0 -115
  238. tests/ui/test_deposits.py +0 -115
  239. tests/ui/test_export_formats.py +0 -37
  240. tests/ui/test_file_download.py +0 -73
  241. tests/ui/test_filters.py +0 -10
  242. tests/ui/test_robotstxt.py +0 -35
  243. tests/ui/test_signposting_ui.py +0 -95
  244. tests/ui/test_sitemaps.py +0 -85
  245. tests/ui/test_stats_ui.py +0 -92
  246. {invenio_app_rdm-13.0.0b4.dev1.dist-info → invenio_app_rdm-14.0.0b1.dev8.dist-info}/WHEEL +0 -0
  247. {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
@@ -1,8 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2025 Graz University of Technology.
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
- """Tests."""
@@ -1,3 +0,0 @@
1
- - name: "Set1"
2
- spec: "set1"
3
- search_pattern: "metadata.resource_type.id:dataset"
@@ -1 +0,0 @@
1
- About page
@@ -1,4 +0,0 @@
1
- - url: /about
2
- title: About
3
- description: About
4
- template: about.html
@@ -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
@@ -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
@@ -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"
@@ -1,7 +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 entry point."""
@@ -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 %}
@@ -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
@@ -1,8 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2025 Graz University of Technology.
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
- """Tests."""
@@ -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