aa-structures 2.3.0__tar.gz → 2.3.1b1__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.
Files changed (176) hide show
  1. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/PKG-INFO +1 -1
  2. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/__init__.py +1 -1
  3. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/models/notifications.py +1 -1
  4. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/models/test_notifications_1.py +38 -12
  5. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/test_integration.py +88 -1
  6. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/testdata/factories_2.py +34 -1
  7. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/.gitignore +0 -0
  8. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/LICENSE +0 -0
  9. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/README.md +0 -0
  10. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/pyproject.toml +0 -0
  11. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/admin.py +0 -0
  12. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/app_settings.py +0 -0
  13. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/apps.py +0 -0
  14. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/auth_hooks.py +0 -0
  15. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/checks.py +0 -0
  16. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/constants.py +0 -0
  17. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/core/__init__.py +0 -0
  18. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/core/notification_embeds.py +0 -0
  19. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/core/notification_timers.py +0 -0
  20. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/core/serializers.py +0 -0
  21. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/core/sovereignty.py +0 -0
  22. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/core/starbases.py +0 -0
  23. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/forms.py +0 -0
  24. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/helpers/__init__.py +0 -0
  25. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/helpers/general.py +0 -0
  26. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/locale/de/LC_MESSAGES/django.mo +0 -0
  27. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/locale/de/LC_MESSAGES/django.po +0 -0
  28. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/locale/django.pot +0 -0
  29. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/locale/en/LC_MESSAGES/django.mo +0 -0
  30. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/locale/en/LC_MESSAGES/django.po +0 -0
  31. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/locale/es/LC_MESSAGES/django.mo +0 -0
  32. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/locale/es/LC_MESSAGES/django.po +0 -0
  33. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/locale/fr_FR/LC_MESSAGES/django.po +0 -0
  34. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/locale/it_IT/LC_MESSAGES/django.po +0 -0
  35. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/locale/ja/LC_MESSAGES/django.po +0 -0
  36. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/locale/ko/LC_MESSAGES/django.mo +0 -0
  37. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/locale/ko/LC_MESSAGES/django.po +0 -0
  38. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/locale/ko_KR/LC_MESSAGES/django.po +0 -0
  39. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/locale/ru/LC_MESSAGES/django.mo +0 -0
  40. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/locale/ru/LC_MESSAGES/django.po +0 -0
  41. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/locale/uk/LC_MESSAGES/django.po +0 -0
  42. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/locale/zh_Hans/LC_MESSAGES/django.mo +0 -0
  43. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/locale/zh_Hans/LC_MESSAGES/django.po +0 -0
  44. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/management/commands/__init__.py +0 -0
  45. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/management/commands/structures_load_eve.py +0 -0
  46. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/management/commands/structures_preload_eveuniverse.py +0 -0
  47. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/managers.py +0 -0
  48. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/migrations/0001_initial_new.py +0 -0
  49. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/migrations/0002_remove_eveuniverse_relation_names.py +0 -0
  50. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/migrations/0003_add_localization_and_unique_key.py +0 -0
  51. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/migrations/__init__.py +0 -0
  52. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/models/__init__.py +0 -0
  53. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/models/eveuniverse.py +0 -0
  54. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/models/owners.py +0 -0
  55. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/models/structures.py +0 -0
  56. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/providers.py +0 -0
  57. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/css/global.css +0 -0
  58. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/css/main.css +0 -0
  59. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/Spinner-1s-64px-dark.gif +0 -0
  60. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/Spinner-1s-64px-light.gif +0 -0
  61. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/eve_symbol_128.png +0 -0
  62. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/0h.png +0 -0
  63. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/0l.png +0 -0
  64. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/0m.png +0 -0
  65. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/0r.png +0 -0
  66. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/0s.png +0 -0
  67. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/1h.png +0 -0
  68. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/1l.png +0 -0
  69. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/1m.png +0 -0
  70. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/1r.png +0 -0
  71. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/2h.png +0 -0
  72. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/2l.png +0 -0
  73. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/2m.png +0 -0
  74. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/2r.png +0 -0
  75. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/3h.png +0 -0
  76. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/3l.png +0 -0
  77. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/3m.png +0 -0
  78. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/3r.png +0 -0
  79. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/4h.png +0 -0
  80. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/4l.png +0 -0
  81. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/4m.png +0 -0
  82. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/4s.png +0 -0
  83. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/5h.png +0 -0
  84. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/5l.png +0 -0
  85. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/5m.png +0 -0
  86. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/5s.png +0 -0
  87. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/6h.png +0 -0
  88. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/6l.png +0 -0
  89. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/6m.png +0 -0
  90. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/7h.png +0 -0
  91. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/7l.png +0 -0
  92. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/7m.png +0 -0
  93. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/8h.png +0 -0
  94. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/8l.png +0 -0
  95. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/8m.png +0 -0
  96. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/blank.png +0 -0
  97. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/circle.png +0 -0
  98. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/dustwheel.png +0 -0
  99. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/h.png +0 -0
  100. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/l.png +0 -0
  101. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/m.png +0 -0
  102. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/noship.png +0 -0
  103. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/r.png +0 -0
  104. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/tyrannis.png +0 -0
  105. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/tyrannis_blue.png +0 -0
  106. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/tyrannis_darkred.png +0 -0
  107. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/tyrannis_default.png +0 -0
  108. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/panel/tyrannis_revelations.png +0 -0
  109. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/static/structures/img/structures_logo.png +0 -0
  110. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/swagger.json +0 -0
  111. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tasks.py +0 -0
  112. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/templates/structures/base.html +0 -0
  113. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/templates/structures/main.html +0 -0
  114. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/templates/structures/modals/fitting_assets.html +0 -0
  115. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/templates/structures/modals/fitting_gfx.html +0 -0
  116. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/templates/structures/modals/poco_details.html +0 -0
  117. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/templates/structures/modals/starbase_detail.html +0 -0
  118. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/templates/structures/modals/structure_details.html +0 -0
  119. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/templates/structures/modals/tab_general_detail.html +0 -0
  120. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/templates/structures/partials/jump_gates_list.html +0 -0
  121. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/templates/structures/partials/poco_list.html +0 -0
  122. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/templates/structures/partials/structure_list.html +0 -0
  123. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/templates/structures/partials/structure_summary.html +0 -0
  124. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/templates/structures/templatetags/detail_title.html +0 -0
  125. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/templates/structures/templatetags/list_asset.html +0 -0
  126. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/templates/structures/templatetags/list_item.html +0 -0
  127. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/templates/structures/templatetags/list_tax_item.html +0 -0
  128. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/templates/structures/templatetags/list_title.html +0 -0
  129. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/templatetags/__init__.py +0 -0
  130. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/templatetags/structures.py +0 -0
  131. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/__init__.py +0 -0
  132. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/core/__init__.py +0 -0
  133. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/core/test_notification_embeds.py +0 -0
  134. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/core/test_notification_structuretimers.py +0 -0
  135. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/core/test_notifications_timerboard.py +0 -0
  136. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/core/test_serializers.py +0 -0
  137. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/core/test_sovereignty.py +0 -0
  138. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/core/test_starbases.py +0 -0
  139. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/models/__init__.py +0 -0
  140. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/models/test_eveuniverse.py +0 -0
  141. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/models/test_notifications_2.py +0 -0
  142. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/models/test_notifications_3.py +0 -0
  143. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/models/test_notifications_discord.py +0 -0
  144. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/models/test_owners_1.py +0 -0
  145. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/models/test_owners_2.py +0 -0
  146. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/models/test_owners_3.py +0 -0
  147. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/models/test_structures.py +0 -0
  148. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/test_admin.py +0 -0
  149. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/test_checks.py +0 -0
  150. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/test_helpers.py +0 -0
  151. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/test_managers_1.py +0 -0
  152. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/test_managers_3.py +0 -0
  153. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/test_tasks.py +0 -0
  154. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/test_views.py +0 -0
  155. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/testdata/__init__.py +0 -0
  156. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/testdata/create_eveuniverse.py +0 -0
  157. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/testdata/entities.json +0 -0
  158. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/testdata/esi_data.json +0 -0
  159. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/testdata/eveuniverse.json +0 -0
  160. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/testdata/factories.py +0 -0
  161. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/testdata/generate_notifications.py +0 -0
  162. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/testdata/generate_notifications_2.py +0 -0
  163. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/testdata/generate_structures.py +0 -0
  164. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/testdata/helpers.py +0 -0
  165. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/testdata/load_eveuniverse.py +0 -0
  166. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/testdata/tasks_loadtest.py +0 -0
  167. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/tests/testdata/test_generate_structures.py +0 -0
  168. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/urls.py +0 -0
  169. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/views.py +0 -0
  170. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/webhooks/__init__.py +0 -0
  171. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/webhooks/core.py +0 -0
  172. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/webhooks/managers.py +0 -0
  173. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/webhooks/models.py +0 -0
  174. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/webhooks/tests/__init__.py +0 -0
  175. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/webhooks/tests/test_core.py +0 -0
  176. {aa_structures-2.3.0 → aa_structures-2.3.1b1}/structures/webhooks/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aa-structures
3
- Version: 2.3.0
3
+ Version: 2.3.1b1
4
4
  Summary: App for managing Eve Online structures with Alliance Auth
5
5
  Project-URL: Homepage, https://gitlab.com/ErikKalkoken/aa-structures
6
6
  Project-URL: Documentation, https://aa-structures.readthedocs.io/en/latest/
@@ -1,4 +1,4 @@
1
1
  default_app_config = "structures.apps.StructuresConfig"
2
2
 
3
- __version__ = "2.3.0"
3
+ __version__ = "2.3.1b1"
4
4
  __title__ = "Structures"
@@ -239,7 +239,7 @@ class NotificationType(models.TextChoices):
239
239
  cls.SOV_STRUCTURE_REINFORCED,
240
240
  cls.SOV_STRUCTURE_DESTROYED,
241
241
  cls.SOV_ALL_CLAIM_LOST_MSG,
242
- cls.SOV_ALL_ANCHORING_MSG,
242
+ # cls.SOV_ALL_ANCHORING_MSG, # This notif is not broadcasted to all corporations
243
243
  # wars
244
244
  cls.WAR_ALLY_JOINED_WAR_AGGRESSOR_MSG,
245
245
  cls.WAR_ALLY_JOINED_WAR_AllY_MSG,
@@ -121,47 +121,73 @@ class TestNotificationFilterForAllianceLevel(NoSocketsTestCase):
121
121
  # given
122
122
  self.owner.is_alliance_main = False
123
123
  self.owner.save()
124
- notif = self.owner.notification_set.get(notification_id=1000000509)
124
+ notifs = self.owner.notification_set.exclude(
125
+ notif_type__in=NotificationType.relevant_for_alliance_level
126
+ )
125
127
  # when/then
126
- self.assertFalse(notif.filter_for_alliance_level())
128
+ for notif in notifs:
129
+ with self.subTest(notif=str(notif)):
130
+ self.assertFalse(notif.filter_for_alliance_level())
127
131
 
128
132
  def test_should_not_filter_non_alliance_notifications_2(self):
129
133
  # given
130
134
  self.owner.is_alliance_main = True
131
135
  self.owner.save()
132
- notif = self.owner.notification_set.get(notification_id=1000000509)
136
+ notifs = self.owner.notification_set.exclude(
137
+ notif_type__in=NotificationType.relevant_for_alliance_level
138
+ )
133
139
  # when/then
134
- self.assertFalse(notif.filter_for_alliance_level())
140
+ for notif in notifs:
141
+ with self.subTest(notif=str(notif)):
142
+ self.assertFalse(notif.filter_for_alliance_level())
135
143
 
136
144
  def test_should_filter_alliance_notifications(self):
137
145
  # given
138
146
  self.owner.is_alliance_main = False
139
147
  self.owner.save()
140
- notif = self.owner.notification_set.get(notification_id=1000000803)
148
+ notifs = self.owner.notification_set.filter(
149
+ notif_type__in=NotificationType.relevant_for_alliance_level
150
+ )
141
151
  # when/then
142
- self.assertTrue(notif.filter_for_alliance_level())
152
+ for notif in notifs:
153
+ with self.subTest(notif=str(notif)):
154
+ self.assertTrue(notif.filter_for_alliance_level())
143
155
 
144
156
  def test_should_not_filter_alliance_notifications_1(self):
145
157
  # given
146
158
  self.owner.is_alliance_main = True
147
159
  self.owner.save()
160
+ notifs = self.owner.notification_set.filter(
161
+ notif_type__in=NotificationType.relevant_for_alliance_level
162
+ )
148
163
  # when/then
149
- notif = self.owner.notification_set.get(notification_id=1000000803)
150
- self.assertFalse(notif.filter_for_alliance_level())
164
+ for notif in notifs:
165
+ with self.subTest(notif=str(notif)):
166
+ self.assertFalse(notif.filter_for_alliance_level())
151
167
 
152
168
  def test_should_not_filter_alliance_notifications_2(self):
153
169
  # given
154
170
  self.owner.is_alliance_main = True
155
171
  self.owner.save()
156
- notif = self.owner.notification_set.get(notification_id=1000000803)
157
- self.assertFalse(notif.filter_for_alliance_level())
172
+ notifs = self.owner.notification_set.filter(
173
+ notif_type__in=NotificationType.relevant_for_alliance_level
174
+ )
175
+ # when/then
176
+ for notif in notifs:
177
+ with self.subTest(notif=str(notif)):
178
+ self.assertFalse(notif.filter_for_alliance_level())
158
179
 
159
180
  def test_should_not_filter_alliance_notifications_3(self):
160
181
  # given
161
182
  _, owner = set_owner_character(character_id=1102) # corp with no alliance
162
183
  load_notification_entities(owner)
163
- notif = owner.notification_set.get(notification_id=1000000803)
164
- self.assertFalse(notif.filter_for_alliance_level())
184
+ notifs = self.owner.notification_set.filter(
185
+ notif_type__in=NotificationType.relevant_for_alliance_level
186
+ )
187
+ # when/then
188
+ for notif in notifs:
189
+ with self.subTest(notif=str(notif)):
190
+ self.assertFalse(notif.filter_for_alliance_level())
165
191
 
166
192
 
167
193
  class TestNotificationCreateFromStructure(NoSocketsTestCase):
@@ -16,9 +16,11 @@ from app_utils.esi_testing import EsiClientStub, EsiEndpoint
16
16
  from .. import tasks
17
17
  from ..models import NotificationType, Structure
18
18
  from .testdata.factories_2 import (
19
+ EveEntityAllianceFactory,
19
20
  EveEntityCorporationFactory,
20
21
  NotificationFactory,
21
22
  OwnerFactory,
23
+ RawNotificationFactory,
22
24
  StarbaseFactory,
23
25
  StructureFactory,
24
26
  WebhookFactory,
@@ -431,6 +433,91 @@ class TestTasks(TestCase):
431
433
  if AuthTimer:
432
434
  self.assertTrue(AuthTimer.objects.exists())
433
435
 
436
+ def test_should_fetch_and_send_notification_when_enabled_for_webhook(
437
+ self, mock_esi_2, mock_esi, mock_execute
438
+ ):
439
+ # given
440
+ webhook = WebhookFactory(
441
+ notification_types=[NotificationType.WAR_CORPORATION_BECAME_ELIGIBLE]
442
+ )
443
+ owner = OwnerFactory(webhooks=[webhook], is_alliance_main=True)
444
+ eve_character = owner.characters.first().character_ownership.character
445
+ # corporation_id = owner.corporation.corporation_id
446
+ notif = RawNotificationFactory()
447
+ endpoints = [
448
+ EsiEndpoint(
449
+ "Character",
450
+ "get_characters_character_id_notifications",
451
+ "character_id",
452
+ needs_token=True,
453
+ data={
454
+ str(eve_character.character_id): [notif],
455
+ },
456
+ ),
457
+ ]
458
+ mock_esi.client = mock_esi_2.client = EsiClientStub.create_from_endpoints(
459
+ endpoints
460
+ )
461
+ # when
462
+ tasks.fetch_all_notifications.delay()
463
+ # then
464
+ self.assertTrue(mock_execute.called)
465
+ embed = mock_execute.call_args[1]["embeds"][0]
466
+ self.assertIn("now eligible", embed.description)
467
+
468
+ def test_should_fetch_and_send_notification_when_enabled_for_webhook_all_anchoring(
469
+ self, mock_esi_2, mock_esi, mock_execute
470
+ ):
471
+ # given
472
+ webhook = WebhookFactory(
473
+ notification_types=[NotificationType.SOV_ALL_ANCHORING_MSG]
474
+ )
475
+ owner = OwnerFactory(webhooks=[webhook], is_alliance_main=False)
476
+ eve_character = owner.characters.first().character_ownership.character
477
+ alliance = EveEntityAllianceFactory(
478
+ id=owner.corporation.alliance_id,
479
+ name=owner.corporation.alliance.alliance_name,
480
+ )
481
+ corporation = EveEntityCorporationFactory(
482
+ id=owner.corporation.corporation_id, name=owner.corporation.corporation_name
483
+ )
484
+ starbase = StarbaseFactory(owner=owner)
485
+ notif = RawNotificationFactory(
486
+ type="AllAnchoringMsg",
487
+ sender=corporation,
488
+ data={
489
+ "allianceID": alliance.id,
490
+ "corpID": corporation.id,
491
+ "corpsPresent": [{"allianceID": alliance.id, "corpID": corporation.id}],
492
+ "moonID": starbase.eve_moon.id,
493
+ "solarSystemID": starbase.eve_solar_system.id,
494
+ "towers": [
495
+ {"moonID": starbase.eve_moon.id, "typeID": starbase.eve_type.id}
496
+ ],
497
+ "typeID": starbase.eve_type.id,
498
+ },
499
+ )
500
+ endpoints = [
501
+ EsiEndpoint(
502
+ "Character",
503
+ "get_characters_character_id_notifications",
504
+ "character_id",
505
+ needs_token=True,
506
+ data={
507
+ str(eve_character.character_id): [notif],
508
+ },
509
+ ),
510
+ ]
511
+ mock_esi.client = mock_esi_2.client = EsiClientStub.create_from_endpoints(
512
+ endpoints
513
+ )
514
+ # when
515
+ tasks.fetch_all_notifications.delay()
516
+ # then
517
+ self.assertTrue(mock_execute.called)
518
+ embed = mock_execute.call_args[1]["embeds"][0]
519
+ self.assertIn("has anchored in", embed.description)
520
+
434
521
  @patch(NOTIFICATIONS_PATH + ".STRUCTURES_ADD_TIMERS", True)
435
522
  def test_should_fetch_new_notification_from_esi_and_send_to_webhook_and_create_timers(
436
523
  self, mock_esi_2, mock_esi, mock_execute
@@ -508,7 +595,7 @@ class TestTasks(TestCase):
508
595
  NotificationType.SOV_ALL_CLAIM_LOST_MSG,
509
596
  ]
510
597
  )
511
- owner = OwnerFactory(webhooks=[webhook])
598
+ owner = OwnerFactory(webhooks=[webhook], is_alliance_main=True)
512
599
  NotificationFactory(
513
600
  owner=owner, notif_type=NotificationType.STRUCTURE_DESTROYED
514
601
  )
@@ -142,7 +142,7 @@ class OwnerFactory(factory.django.DjangoModelFactory):
142
142
  assets_last_update_at = factory.LazyFunction(now)
143
143
  character_ownership = None # no longer used
144
144
  forwarding_last_update_at = factory.LazyFunction(now)
145
- is_alliance_main = True
145
+ is_alliance_main = False
146
146
  is_up = True
147
147
  notifications_last_update_at = factory.LazyFunction(now)
148
148
  structures_last_update_at = factory.LazyFunction(now)
@@ -330,3 +330,36 @@ class GeneratedNotificationFactory(factory.django.DjangoModelFactory):
330
330
  state_timer_end=reinforced_until,
331
331
  )
332
332
  obj.structures.add(starbase)
333
+
334
+
335
+ class RawNotificationFactory(factory.DictFactory):
336
+ """Create a raw notification as received from ESI."""
337
+
338
+ class Meta:
339
+ exclude = ("data", "timestamp_dt", "sender")
340
+
341
+ # excluded
342
+ data = None
343
+ timestamp_dt = None
344
+ sender = factory.SubFactory(EveEntityCorporationFactory, id=2902, name="CONCORD")
345
+
346
+ # included
347
+ notification_id = factory.Sequence(lambda o: 1999000000 + o)
348
+ type = "CorpBecameWarEligible"
349
+ sender_id = factory.LazyAttribute(lambda o: o.sender.id)
350
+ sender_type = factory.LazyAttribute(lambda o: o.sender.category)
351
+ is_read = True
352
+
353
+ @factory.lazy_attribute
354
+ def timestamp(self):
355
+ if not self.timestamp_dt:
356
+ timestamp_dt = now()
357
+ else:
358
+ timestamp_dt = self.timestamp_dt
359
+ return datetime_to_esi(timestamp_dt)
360
+
361
+ @factory.lazy_attribute
362
+ def text(self):
363
+ if not self.data:
364
+ return ""
365
+ return yaml.dump(self.data)
File without changes
File without changes