aa-structures 2.12.0__py3-none-any.whl → 2.14.0__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 (37) hide show
  1. {aa_structures-2.12.0.dist-info → aa_structures-2.14.0.dist-info}/METADATA +1 -1
  2. {aa_structures-2.12.0.dist-info → aa_structures-2.14.0.dist-info}/RECORD +37 -34
  3. structures/__init__.py +1 -1
  4. structures/admin.py +1 -1
  5. structures/app_settings.py +4 -0
  6. structures/constants.py +1 -0
  7. structures/core/notification_embeds/main.py +58 -31
  8. structures/core/notification_embeds/orbital_embeds.py +1 -1
  9. structures/core/notification_embeds/skyhook_embeds.py +89 -0
  10. structures/core/notification_embeds/structures_embeds.py +23 -12
  11. structures/core/notification_embeds/tower_embeds.py +1 -1
  12. structures/core/notification_timers.py +53 -6
  13. structures/core/notification_types.py +58 -36
  14. structures/managers.py +22 -8
  15. structures/migrations/0007_add_notificationtypes_skyhook_metenox.py +149 -0
  16. structures/migrations/0008_add_notificationtypes_skyhook_metenox.py +149 -0
  17. structures/models/owners.py +68 -8
  18. structures/models/structures_1.py +5 -0
  19. structures/templates/structures/public.html +2 -2
  20. structures/templates/structures/structures.html +3 -3
  21. structures/tests/core/test_notification_types.py +16 -0
  22. structures/tests/core/{test_notifications_timerboard.py → test_notifications_timers.py} +6 -1
  23. structures/tests/integration/test_tasks.py +102 -1
  24. structures/tests/integration/test_views.py +1 -1
  25. structures/tests/models/test_owners_5.py +135 -1
  26. structures/tests/models/test_structures.py +49 -42
  27. structures/tests/test_managers_1.py +11 -1
  28. structures/tests/testdata/create_eveuniverse.py +6 -1
  29. structures/tests/testdata/entities.json +71 -1
  30. structures/tests/testdata/eveuniverse.json +6306 -5145
  31. structures/tests/testdata/factories.py +21 -0
  32. structures/tests/testdata/generate_notifications.py +142 -157
  33. structures/tests/testdata/helpers.py +6 -0
  34. structures/tests/views/test_structures.py +12 -4
  35. structures/views/structures.py +6 -6
  36. {aa_structures-2.12.0.dist-info → aa_structures-2.14.0.dist-info}/LICENSE +0 -0
  37. {aa_structures-2.12.0.dist-info → aa_structures-2.14.0.dist-info}/WHEEL +0 -0
@@ -25,6 +25,7 @@ from .testdata.factories import (
25
25
  EveSovereigntyMapFactory,
26
26
  OwnerFactory,
27
27
  PocoFactory,
28
+ SkyhookFactory,
28
29
  StarbaseFactory,
29
30
  StructureFactory,
30
31
  StructureTagFactory,
@@ -304,12 +305,15 @@ class TestStructureQuerySet(NoSocketsTestCase):
304
305
  cls.structure = StructureFactory(owner=cls.owner)
305
306
  cls.poco = PocoFactory(owner=cls.owner)
306
307
  cls.starbase = StarbaseFactory(owner=cls.owner)
308
+ cls.skyhook = SkyhookFactory(owner=cls.owner)
307
309
 
308
310
  def test_should_return_ids_as_set(self):
309
311
  # when
310
312
  ids = Structure.objects.ids()
311
313
  # then
312
- self.assertSetEqual(ids, {self.structure.id, self.poco.id, self.starbase.id})
314
+ self.assertSetEqual(
315
+ ids, {self.structure.id, self.poco.id, self.starbase.id, self.skyhook.id}
316
+ )
313
317
 
314
318
  def test_should_filter_upwell_structures(self):
315
319
  # when
@@ -329,6 +333,12 @@ class TestStructureQuerySet(NoSocketsTestCase):
329
333
  # then
330
334
  self.assertSetEqual(result_qs.ids(), {self.starbase.id})
331
335
 
336
+ def test_should_filter_skyhooks(self):
337
+ # when
338
+ result_qs = Structure.objects.filter_skyhooks()
339
+ # then
340
+ self.assertSetEqual(result_qs.ids(), {self.skyhook.id})
341
+
332
342
 
333
343
  class TestStructureQuerySetVisibleForUser(NoSocketsTestCase):
334
344
  @classmethod
@@ -16,6 +16,11 @@ class CreateEveUniverseTestData(TestCase):
16
16
  include_children=True,
17
17
  enabled_sections=[EveType.Section.DOGMAS],
18
18
  ),
19
+ ModelSpec(
20
+ "EveCategory",
21
+ ids=[EveCategoryId.ORBITAL],
22
+ include_children=True,
23
+ ),
19
24
  ModelSpec(
20
25
  "EveGroup",
21
26
  ids=[EveGroupId.CONTROL_TOWER],
@@ -24,7 +29,7 @@ class CreateEveUniverseTestData(TestCase):
24
29
  ),
25
30
  ModelSpec(
26
31
  "EveType",
27
- ids=[EveTypeId.TCU, EveTypeId.IHUB, EveTypeId.CUSTOMS_OFFICE],
32
+ ids=[EveTypeId.TCU, EveTypeId.IHUB],
28
33
  include_children=True,
29
34
  enabled_sections=[EveType.Section.DOGMAS],
30
35
  ),
@@ -251,7 +251,7 @@
251
251
  "notification_id": 1000000511,
252
252
  "type": "StructureWentLowPower",
253
253
  "sender_id": 2901,
254
- "sender_type": "other",
254
+ "sender_type": "corporation",
255
255
  "timestamp": "2019-11-20 22:02:00",
256
256
  "text": "solarsystemID: 30002537\nstructureID: &id001 1000000000001\nstructureShowInfoData:\n- showinfo\n- 35832\n- *id001\nstructureTypeID: 35832\n",
257
257
  "is_read": false
@@ -736,6 +736,76 @@
736
736
  "is_read": false,
737
737
  "is_sent": false
738
738
  },
739
+ {
740
+ "notification_id": 1000001201,
741
+ "type": "SkyhookUnderAttack",
742
+ "sender_id": 2901,
743
+ "sender_type": "corporation",
744
+ "timestamp": "2019-11-18 20:00:00",
745
+ "text": "allianceID: 3011\nallianceLinkData:\n- showinfo\n- 16159\n- 3011\nallianceName: Big Bad Alliance\narmorPercentage: 99.97623738812345\ncharID: 1011\ncorpLinkData:\n- showinfo\n- 2\n- 2011\ncorpName: Bad Company\nhullPercentage: 100.0\nisActive: true\nitemID: &id001 1000000010001\nplanetID: 40161469\nplanetShowInfoData:\n- showinfo\n- 2016\n- 40161469\nshieldPercentage: 1.6855855838775617e-09\nskyhookShowInfoData:\n- showinfo\n- 81080\n- *id001\nsolarsystemID: 30002537\ntypeID: 81080",
746
+ "is_read": false,
747
+ "is_sent": false
748
+ },
749
+ {
750
+ "notification_id": 1000001202,
751
+ "type": "SkyhookLostShields",
752
+ "sender_id": 2901,
753
+ "sender_type": "corporation",
754
+ "timestamp": "2019-11-18 20:00:00",
755
+ "text": "itemID: &id001 1000000010001\nplanetID: 40161469\nplanetShowInfoData:\n- showinfo\n- 2016\n- 40161469\nskyhookShowInfoData:\n- showinfo\n- 81080\n- *id001\nsolarsystemID: 30002537\ntimeLeft: 1378460630068\ntimestamp: 133661870440000000\ntypeID: 81080\nvulnerableTime: 9000000000",
756
+ "is_read": false,
757
+ "is_sent": false
758
+ },
759
+ {
760
+ "notification_id": 1000001203,
761
+ "type": "SkyhookDestroyed",
762
+ "sender_id": 2901,
763
+ "sender_type": "corporation",
764
+ "timestamp": "2019-11-18 20:00:00",
765
+ "text": "itemID: &id001 1000000010001\nplanetID: 40161469\nplanetShowInfoData:\n- showinfo\n- 2016\n- 40161469\nskyhookShowInfoData:\n- showinfo\n- 81080\n- *id001\nsolarsystemID: 30002537\ntypeID: 81080",
766
+ "is_read": false,
767
+ "is_sent": false
768
+ },
769
+ {
770
+ "notification_id": 1000001204,
771
+ "type": "SkyhookDeployed",
772
+ "sender_id": 2901,
773
+ "sender_type": "corporation",
774
+ "timestamp": "2019-11-18 20:00:00",
775
+ "text": "itemID: &id002 1000000010001\nownerCorpLinkData:\n- showinfo\n- 2\n- 2001\nownerCorpName: Good Company\nplanetID: &id001 40161469\nplanetShowInfoData:\n- showinfo\n- 2016\n- *id001\nskyhookShowInfoData:\n- showinfo\n- 81080\n- *id002\nsolarsystemID: 30002537\ntimeLeft: 18000000000\ntypeID: 81080",
776
+ "is_read": false,
777
+ "is_sent": false
778
+ },
779
+ {
780
+ "notification_id": 1000001205,
781
+ "type": "SkyhookOnline",
782
+ "sender_id": 2901,
783
+ "sender_type": "corporation",
784
+ "timestamp": "2019-11-18 20:00:00",
785
+ "text": "itemID: &id002 1000000010001\nplanetID: &id001 40161469\nplanetShowInfoData:\n- showinfo\n- 2016\n- *id001\nskyhookShowInfoData:\n- showinfo\n- 81080\n- *id002\nsolarsystemID: 30002537\ntypeID: 81080",
786
+ "is_read": false,
787
+ "is_sent": false
788
+ },
789
+ {
790
+ "notification_id": 1000001301,
791
+ "type": "StructureLowReagentsAlert",
792
+ "sender_id": 2901,
793
+ "sender_type": "corporation",
794
+ "timestamp": "2019-11-18 20:00:00",
795
+ "text": "solarsystemID: 30002537\nstructureID: &id001 1000000000001\nstructureShowInfoData:\n- showinfo\n- 81826\n- *id001\nstructureTypeID: 81826",
796
+ "is_read": false,
797
+ "is_sent": false
798
+ },
799
+ {
800
+ "notification_id": 1000001302,
801
+ "type": "StructureNoReagentsAlert",
802
+ "sender_id": 2901,
803
+ "sender_type": "corporation",
804
+ "timestamp": "2019-11-18 20:00:00",
805
+ "text": "solarsystemID: 30002537\nstructureID: &id001 1000000000001\nstructureShowInfoData:\n- showinfo\n- 81826\n- *id001\nstructureTypeID: 81826",
806
+ "is_read": false,
807
+ "is_sent": false
808
+ },
739
809
  {
740
810
  "notification_id": 1999999999,
741
811
  "type": "UnknownNotificationType",