aa-structures 2.8.0__py3-none-any.whl → 2.9.1__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 (62) hide show
  1. {aa_structures-2.8.0.dist-info → aa_structures-2.9.1.dist-info}/METADATA +2 -2
  2. {aa_structures-2.8.0.dist-info → aa_structures-2.9.1.dist-info}/RECORD +62 -61
  3. structures/__init__.py +1 -1
  4. structures/admin.py +3 -3
  5. structures/app_settings.py +88 -69
  6. structures/core/notification_embeds/billing_embeds.py +40 -7
  7. structures/core/notification_embeds/{character_embeds.py → corporate_embeds.py} +23 -13
  8. structures/core/notification_embeds/main.py +76 -38
  9. structures/core/notification_embeds/moonmining_embeds.py +12 -17
  10. structures/core/notification_embeds/orbital_embeds.py +3 -8
  11. structures/core/notification_embeds/sov_embeds.py +21 -19
  12. structures/core/notification_embeds/structures_embeds.py +19 -26
  13. structures/core/notification_embeds/tower_embeds.py +2 -2
  14. structures/core/notification_embeds/war_embeds.py +298 -92
  15. structures/core/notification_types.py +63 -44
  16. structures/forms.py +0 -1
  17. structures/helpers.py +13 -0
  18. structures/locale/de/LC_MESSAGES/django.po +488 -302
  19. structures/locale/django.pot +494 -308
  20. structures/locale/en/LC_MESSAGES/django.po +494 -308
  21. structures/locale/es/LC_MESSAGES/django.po +488 -302
  22. structures/locale/fr_FR/LC_MESSAGES/django.po +494 -308
  23. structures/locale/it_IT/LC_MESSAGES/django.po +494 -308
  24. structures/locale/ja/LC_MESSAGES/django.po +494 -308
  25. structures/locale/ko_KR/LC_MESSAGES/django.po +488 -302
  26. structures/locale/ru/LC_MESSAGES/django.mo +0 -0
  27. structures/locale/ru/LC_MESSAGES/django.po +532 -349
  28. structures/locale/uk/LC_MESSAGES/django.po +488 -302
  29. structures/locale/zh_Hans/LC_MESSAGES/django.po +488 -302
  30. structures/migrations/0005_add_notification_types.py +135 -0
  31. structures/models/eveuniverse.py +0 -1
  32. structures/models/notifications.py +1 -1
  33. structures/models/owners.py +3 -1
  34. structures/tests/core/notification_embeds/test_main.py +29 -27
  35. structures/tests/core/test_notification_structuretimers.py +2 -1
  36. structures/tests/core/test_notifications_timerboard.py +2 -1
  37. structures/tests/core/test_serializers.py +4 -2
  38. structures/tests/core/test_starbases.py +4 -2
  39. structures/tests/integration/test_tasks.py +2 -1
  40. structures/tests/integration/test_views.py +6 -3
  41. structures/tests/models/test_eveuniverse.py +2 -1
  42. structures/tests/models/test_notifications_1.py +16 -21
  43. structures/tests/models/test_notifications_2.py +4 -2
  44. structures/tests/models/test_notifications_3.py +6 -3
  45. structures/tests/models/test_notifications_discord.py +2 -1
  46. structures/tests/models/test_owners_1.py +28 -4
  47. structures/tests/models/test_owners_2.py +2 -1
  48. structures/tests/models/test_owners_3.py +2 -1
  49. structures/tests/models/test_owners_4.py +2 -1
  50. structures/tests/models/test_owners_5.py +8 -4
  51. structures/tests/models/test_structures.py +16 -8
  52. structures/tests/test_helpers.py +23 -3
  53. structures/tests/test_managers_1.py +16 -8
  54. structures/tests/test_managers_2.py +2 -1
  55. structures/tests/test_tasks.py +12 -6
  56. structures/tests/testdata/entities.json +150 -0
  57. structures/tests/testdata/helpers.py +1 -0
  58. structures/tests/views/test_public.py +2 -1
  59. structures/tests/views/test_statistics.py +2 -1
  60. structures/tests/views/test_structures.py +20 -10
  61. {aa_structures-2.8.0.dist-info → aa_structures-2.9.1.dist-info}/LICENSE +0 -0
  62. {aa_structures-2.8.0.dist-info → aa_structures-2.9.1.dist-info}/WHEEL +0 -0
@@ -21,7 +21,8 @@ MODULE_PATH = "structures.models.owners"
21
21
  @patch(MODULE_PATH + ".esi")
22
22
  class TestUpdatePocosEsi(NoSocketsTestCase):
23
23
  @classmethod
24
- def setUpTestData(cls):
24
+ def setUpClass(cls):
25
+ super().setUpClass()
25
26
  load_eveuniverse()
26
27
  cls.user = UserMainDefaultOwnerFactory()
27
28
  cls.owner = OwnerFactory(user=cls.user, structures_last_update_at=None)
@@ -24,7 +24,8 @@ MODULE_PATH = "structures.models.owners"
24
24
  @patch(MODULE_PATH + ".esi")
25
25
  class TestUpdateStarbasesEsi(NoSocketsTestCase):
26
26
  @classmethod
27
- def setUpTestData(cls):
27
+ def setUpClass(cls):
28
+ super().setUpClass()
28
29
  load_eveuniverse()
29
30
  cls.user = UserMainDefaultOwnerFactory()
30
31
  cls.owner = OwnerFactory(user=cls.user, structures_last_update_at=None)
@@ -39,7 +39,8 @@ NOTIFICATIONS_PATH = "structures.models.notifications"
39
39
  @patch(OWNERS_PATH + ".esi")
40
40
  class TestFetchNotificationsEsi(NoSocketsTestCase):
41
41
  @classmethod
42
- def setUpTestData(cls):
42
+ def setUpClass(cls):
43
+ super().setUpClass()
43
44
  load_eveuniverse()
44
45
  cls.sender_corporation = EveEntityCorporationFactory()
45
46
  cls.character = EveCharacterFactory()
@@ -254,7 +255,8 @@ class TestFetchNotificationsEsi(NoSocketsTestCase):
254
255
  @patch(NOTIFICATIONS_PATH + ".Webhook.send_message", spec=True)
255
256
  class TestSendNewNotifications(NoSocketsTestCase):
256
257
  @classmethod
257
- def setUpTestData(cls):
258
+ def setUpClass(cls):
259
+ super().setUpClass()
258
260
  load_eveuniverse()
259
261
  load_eve_entities()
260
262
  cls.owner = OwnerFactory(
@@ -383,7 +385,8 @@ class TestSendNewNotifications(NoSocketsTestCase):
383
385
  @patch(OWNERS_PATH + ".esi")
384
386
  class TestOwnerUpdateAssetEsi(NoSocketsTestCase):
385
387
  @classmethod
386
- def setUpTestData(cls):
388
+ def setUpClass(cls):
389
+ super().setUpClass()
387
390
  load_eveuniverse()
388
391
  cls.corporation = EveCharacterFactory()
389
392
  character = EveCharacterFactory(corporation=cls.corporation)
@@ -737,7 +740,8 @@ class TestOwnerToken(NoSocketsTestCase):
737
740
  @patch(OWNERS_PATH + ".notify_admins")
738
741
  class TestOwnerUpdateIsUp(NoSocketsTestCase):
739
742
  @classmethod
740
- def setUpTestData(cls):
743
+ def setUpClass(cls):
744
+ super().setUpClass()
741
745
  load_eveuniverse()
742
746
  cls.corporation = EveCorporationInfoFactory()
743
747
 
@@ -46,7 +46,8 @@ EVE_ID_NITROGEN_FUEL_BLOCK = 4051
46
46
 
47
47
  class TestPocoDetails(NoSocketsTestCase):
48
48
  @classmethod
49
- def setUpTestData(cls):
49
+ def setUpClass(cls):
50
+ super().setUpClass()
50
51
  load_eveuniverse()
51
52
  cls.owner = OwnerFactory()
52
53
  cls.structure = PocoFactory(owner=cls.owner, poco_details=False)
@@ -204,7 +205,8 @@ class TestPocoDetails(NoSocketsTestCase):
204
205
 
205
206
  class TestStructure(NoSocketsTestCase):
206
207
  @classmethod
207
- def setUpTestData(cls):
208
+ def setUpClass(cls):
209
+ super().setUpClass()
208
210
  load_eveuniverse()
209
211
  cls.owner = OwnerFactory()
210
212
 
@@ -490,7 +492,8 @@ class TestStructure(NoSocketsTestCase):
490
492
 
491
493
  class TestStructureFuel(NoSocketsTestCase):
492
494
  @classmethod
493
- def setUpTestData(cls):
495
+ def setUpClass(cls):
496
+ super().setUpClass()
494
497
  load_eveuniverse()
495
498
  cls.owner = OwnerFactory()
496
499
 
@@ -683,7 +686,8 @@ class TestStructureFuel(NoSocketsTestCase):
683
686
  @patch(STRUCTURES_PATH + ".Structure.FUEL_DATES_EQUAL_THRESHOLD_STARBASE", 7200)
684
687
  class TestStructureFuelLevels(NoSocketsTestCase):
685
688
  @classmethod
686
- def setUpTestData(cls):
689
+ def setUpClass(cls):
690
+ super().setUpClass()
687
691
  load_eveuniverse()
688
692
  cls.owner = OwnerFactory(
689
693
  webhooks__notification_types=[NotificationType.STRUCTURE_REFUELED_EXTRA]
@@ -845,7 +849,8 @@ class TestStructureFuelLevels(NoSocketsTestCase):
845
849
 
846
850
  class TestStructurePowerMode(NoSocketsTestCase):
847
851
  @classmethod
848
- def setUpTestData(cls):
852
+ def setUpClass(cls):
853
+ super().setUpClass()
849
854
  load_eveuniverse()
850
855
  cls.owner = OwnerFactory()
851
856
 
@@ -929,7 +934,8 @@ class TestStructurePowerMode(NoSocketsTestCase):
929
934
 
930
935
  class TestStructureTags(NoSocketsTestCase):
931
936
  @classmethod
932
- def setUpTestData(cls) -> None:
937
+ def setUpClass(cls):
938
+ super().setUpClass()
933
939
  load_eveuniverse()
934
940
  cls.owner = OwnerFactory()
935
941
  EveSovereigntyMapFactory(
@@ -1041,7 +1047,8 @@ class TestStructureTag(NoSocketsTestCase):
1041
1047
 
1042
1048
  class TestStructureSave(NoSocketsTestCase):
1043
1049
  @classmethod
1044
- def setUpTestData(cls):
1050
+ def setUpClass(cls):
1051
+ super().setUpClass()
1045
1052
  load_eveuniverse()
1046
1053
  cls.owner = OwnerFactory()
1047
1054
  EveSovereigntyMapFactory(
@@ -1110,7 +1117,8 @@ class TestStructureNoSetup(NoSocketsTestCase):
1110
1117
 
1111
1118
  class TestStructureService(NoSocketsTestCase):
1112
1119
  @classmethod
1113
- def setUpTestData(cls):
1120
+ def setUpClass(cls):
1121
+ super().setUpClass()
1114
1122
  load_eveuniverse()
1115
1123
 
1116
1124
  def test_str(self):
@@ -3,13 +3,15 @@ import datetime as dt
3
3
  from django.test import TestCase
4
4
  from django.utils.safestring import mark_safe
5
5
  from django.utils.timezone import now
6
- from eveuniverse.models import EveType
6
+ from eveuniverse.models import EveEntity, EveType
7
7
  from eveuniverse.tests.testdata.factories_2 import EveTypeFactory
8
8
 
9
9
  from structures.helpers import (
10
10
  datetime_almost_equal,
11
11
  floating_icon_with_text_html,
12
12
  get_or_create_esi_obj,
13
+ get_or_create_eve_entity,
14
+ get_or_create_eve_type,
13
15
  hours_until_deadline,
14
16
  is_absolute_url,
15
17
  )
@@ -78,8 +80,8 @@ class TestIsAbsoluteUrl(TestCase):
78
80
  self.assertIs(is_absolute_url(url), expected_result)
79
81
 
80
82
 
81
- class TestGetOrCreateEsiObj(TestCase):
82
- def test_should_return_existing_obj(self):
83
+ class TestGetOrCreateObjs(TestCase):
84
+ def test_should_return_existing_obj_generic(self):
83
85
  # given
84
86
  obj = EveTypeFactory()
85
87
  # when
@@ -87,6 +89,24 @@ class TestGetOrCreateEsiObj(TestCase):
87
89
  # then
88
90
  self.assertEqual(obj, obj_2)
89
91
 
92
+ def test_should_return_existing_obj_type(self):
93
+ # given
94
+ obj = EveTypeFactory()
95
+ # when
96
+ obj_2 = get_or_create_eve_type(id=obj.id)
97
+ # then
98
+ self.assertEqual(obj, obj_2)
99
+
100
+ def test_should_return_existing_obj_entity(self):
101
+ # given
102
+ obj = EveEntity.objects.create(
103
+ id=99, name="test", category=EveEntity.CATEGORY_CHARACTER
104
+ )
105
+ # when
106
+ obj_2 = get_or_create_eve_entity(id=obj.id)
107
+ # then
108
+ self.assertEqual(obj, obj_2)
109
+
90
110
 
91
111
  class TestIconWithParagraphHtml(TestCase):
92
112
  def test_should_create_html_with_one_line(self):
@@ -38,7 +38,8 @@ MODULE_PATH_ESI_FETCH = "structures.helpers.esi_fetch"
38
38
 
39
39
  class TestEveSovereigntyMapManagerUpdateFromEsi(NoSocketsTestCase):
40
40
  @classmethod
41
- def setUpTestData(cls) -> None:
41
+ def setUpClass(cls):
42
+ super().setUpClass()
42
43
  endpoints = [
43
44
  EsiEndpoint(
44
45
  "Sovereignty",
@@ -109,7 +110,8 @@ class TestEveSovereigntyMapManagerUpdateFromEsi(NoSocketsTestCase):
109
110
 
110
111
  class TestEveSovereigntyMapManagerOther(NoSocketsTestCase):
111
112
  @classmethod
112
- def setUpTestData(cls):
113
+ def setUpClass(cls):
114
+ super().setUpClass()
113
115
  load_eveuniverse()
114
116
  cls.corporation = EveCorporationInfoFactory()
115
117
  solar_system = EveSolarSystem.objects.get(name="1-PGSG")
@@ -168,7 +170,8 @@ class TestEveSovereigntyMapManagerOther(NoSocketsTestCase):
168
170
  @patch(MODULE_PATH + ".esi")
169
171
  class TestStructureManagerEsi(NoSocketsTestCase):
170
172
  @classmethod
171
- def setUpTestData(cls):
173
+ def setUpClass(cls):
174
+ super().setUpClass()
172
175
  load_eveuniverse()
173
176
  cls.owner = OwnerFactory()
174
177
  cls.token = cls.owner.fetch_token()
@@ -294,7 +297,8 @@ class TestStructureManagerEsi(NoSocketsTestCase):
294
297
 
295
298
  class TestStructureQuerySet(NoSocketsTestCase):
296
299
  @classmethod
297
- def setUpTestData(cls):
300
+ def setUpClass(cls):
301
+ super().setUpClass()
298
302
  load_eveuniverse()
299
303
  cls.owner = OwnerFactory()
300
304
  cls.structure = StructureFactory(owner=cls.owner)
@@ -328,7 +332,8 @@ class TestStructureQuerySet(NoSocketsTestCase):
328
332
 
329
333
  class TestStructureQuerySetVisibleForUser(NoSocketsTestCase):
330
334
  @classmethod
331
- def setUpTestData(cls):
335
+ def setUpClass(cls):
336
+ super().setUpClass()
332
337
  load_eveuniverse()
333
338
  cls.owner = OwnerFactory()
334
339
  # same alliance
@@ -439,7 +444,8 @@ class TestStructureQuerySetVisibleForUser(NoSocketsTestCase):
439
444
 
440
445
  class TestStructureQuerySetFilterTags(NoSocketsTestCase):
441
446
  @classmethod
442
- def setUpTestData(cls):
447
+ def setUpClass(cls):
448
+ super().setUpClass()
443
449
  load_eveuniverse()
444
450
  owner = OwnerFactory()
445
451
  tag_a = StructureTagFactory(name="tag_a")
@@ -489,7 +495,8 @@ class TestStructureQuerySetFilterTags(NoSocketsTestCase):
489
495
 
490
496
  class TestStructureManagerCreateFromDict(NoSocketsTestCase):
491
497
  @classmethod
492
- def setUpTestData(cls):
498
+ def setUpClass(cls):
499
+ super().setUpClass()
493
500
  load_eveuniverse()
494
501
  cls.owner = OwnerFactory()
495
502
 
@@ -683,7 +690,8 @@ class TestStructureManagerCreateFromDict(NoSocketsTestCase):
683
690
 
684
691
  class TestStructureTagManager(NoSocketsTestCase):
685
692
  @classmethod
686
- def setUpTestData(cls):
693
+ def setUpClass(cls):
694
+ super().setUpClass()
687
695
  load_eveuniverse()
688
696
  cls.corporation = EveCorporationInfoFactory()
689
697
  solar_system = EveSolarSystem.objects.get(name="1-PGSG")
@@ -25,7 +25,8 @@ MANAGERS_PATH = "structures.managers"
25
25
  )
26
26
  class TestNotificationBaseAddOrRemoveTimers(NoSocketsTestCase):
27
27
  @classmethod
28
- def setUpTestData(cls):
28
+ def setUpClass(cls):
29
+ super().setUpClass()
29
30
  load_eveuniverse()
30
31
 
31
32
  def test_should_create_new_timers_from_notifications(
@@ -50,7 +50,8 @@ class TestSendMessagesForWebhook(TestCase):
50
50
  @patch(MODULE_PATH + ".Owner.update_structures_esi", spec=True)
51
51
  class TestUpdateStructuresEsi(NoSocketsTestCase):
52
52
  @classmethod
53
- def setUpTestData(cls):
53
+ def setUpClass(cls):
54
+ super().setUpClass()
54
55
  cls.user = UserMainDefaultOwnerFactory()
55
56
  cls.owner = OwnerFactory(user=cls.user, is_alliance_main=True)
56
57
 
@@ -85,7 +86,8 @@ class TestUpdateStructuresEsi(NoSocketsTestCase):
85
86
  @patch(MODULE_PATH + ".update_structures_for_owner", spec=True)
86
87
  class TestUpdateStructuresForOwner(NoSocketsTestCase):
87
88
  @classmethod
88
- def setUpTestData(cls):
89
+ def setUpClass(cls):
90
+ super().setUpClass()
89
91
  cls.user = UserMainDefaultOwnerFactory()
90
92
  cls.owner = OwnerFactory(user=cls.user, is_alliance_main=True)
91
93
 
@@ -117,7 +119,8 @@ class TestUpdateStructuresForOwner(NoSocketsTestCase):
117
119
  @override_settings(CELERY_ALWAYS_EAGER=True, CELERY_EAGER_PROPAGATES_EXCEPTIONS=True)
118
120
  class TestUpdateOwnerAsset(NoSocketsTestCase):
119
121
  @classmethod
120
- def setUpTestData(cls):
122
+ def setUpClass(cls):
123
+ super().setUpClass()
121
124
  cls.user = UserMainDefaultOwnerFactory()
122
125
  cls.owner = OwnerFactory(user=cls.user, is_alliance_main=True)
123
126
 
@@ -157,7 +160,8 @@ class TestUpdateOwnerAsset(NoSocketsTestCase):
157
160
  @patch(MODULE_PATH + ".process_notifications_for_owner", spec=True)
158
161
  class TestFetchAllNotifications(NoSocketsTestCase):
159
162
  @classmethod
160
- def setUpTestData(cls):
163
+ def setUpClass(cls):
164
+ super().setUpClass()
161
165
  cls.user = UserMainDefaultOwnerFactory()
162
166
  cls.owner = OwnerFactory(user=cls.user, is_alliance_main=True)
163
167
 
@@ -245,7 +249,8 @@ class TestFetchAllNotifications(NoSocketsTestCase):
245
249
  @patch("structures.models.notifications.Webhook.send_test_message", spec=True)
246
250
  class TestSendTestNotification(NoSocketsTestCase):
247
251
  @classmethod
248
- def setUpTestData(cls):
252
+ def setUpClass(cls):
253
+ super().setUpClass()
249
254
  cls.user = UserMainDefaultOwnerFactory()
250
255
  cls.owner = OwnerFactory(user=cls.user, is_alliance_main=True)
251
256
 
@@ -281,7 +286,8 @@ class TestSendTestNotification(NoSocketsTestCase):
281
286
  @patch("structures.models.notifications.Notification.update_related_structures")
282
287
  class TestUpdateNotificationsStructureRelations(NoSocketsTestCase):
283
288
  @classmethod
284
- def setUpTestData(cls):
289
+ def setUpClass(cls):
290
+ super().setUpClass()
285
291
  cls.owner = OwnerFactory(is_alliance_main=True)
286
292
 
287
293
  def test_should_run_updates(self, mock_update_related_structures):
@@ -595,6 +595,156 @@
595
595
  "text": "solarSystemID: 30000474\nstructureTypeID: 32458\n",
596
596
  "is_read": false,
597
597
  "is_sent": false
598
+ },
599
+ {
600
+ "notification_id": 1000001121,
601
+ "type": "AcceptedAlly",
602
+ "sender_id": 2902,
603
+ "sender_type": "corporation",
604
+ "timestamp": "2019-11-18 20:00:00",
605
+ "text": "allyID: 2001\ncharID: 1011\nenemyID: 3011\niskValue: 0.0\ntime: 132476139000000000",
606
+ "is_read": false,
607
+ "is_sent": false
608
+ },
609
+ {
610
+ "notification_id": 1000001122,
611
+ "type": "MercOfferedNegotiationMsg",
612
+ "sender_id": 2902,
613
+ "sender_type": "corporation",
614
+ "timestamp": "2019-11-18 20:00:00",
615
+ "text": "aggressorID: 3011\ndefenderID: 3001\niskValue: 0.0\nmercID: 2001",
616
+ "is_read": false,
617
+ "is_sent": false
618
+ },
619
+ {
620
+ "notification_id": 1000001123,
621
+ "type": "MercOfferRetractedMsg",
622
+ "sender_id": 2902,
623
+ "sender_type": "corporation",
624
+ "timestamp": "2019-11-18 20:00:00",
625
+ "text": "aggressorID: 3011\ndefenderID: 3001\nmercID: 2001",
626
+ "is_read": false,
627
+ "is_sent": false
628
+ },
629
+ {
630
+ "notification_id": 1000001124,
631
+ "type": "WarHQRemovedFromSpace",
632
+ "sender_id": 2902,
633
+ "sender_type": "corporation",
634
+ "timestamp": "2019-11-18 20:00:00",
635
+ "text": "againstID: 3011\ndeclaredByID: 2001\ntimeDeclared: 133330953000000000\nwarHQ: Ikuchi - Hisec Loves You",
636
+ "is_read": false,
637
+ "is_sent": false
638
+ },
639
+ {
640
+ "notification_id": 1000001125,
641
+ "type": "WarInvalid",
642
+ "sender_id": 2902,
643
+ "sender_type": "corporation",
644
+ "timestamp": "2019-11-18 20:00:00",
645
+ "text": "againstID: 2001\ndeclaredByID: 3011\nendDate: 133441135200000000",
646
+ "is_read": false,
647
+ "is_sent": false
648
+ },
649
+ {
650
+ "notification_id": 1000001126,
651
+ "type": "DeclareWar",
652
+ "sender_id": 2902,
653
+ "sender_type": "corporation",
654
+ "timestamp": "2019-11-18 20:00:00",
655
+ "text": "charID: 1011\ndefenderID: 3001\nentityID: 3011",
656
+ "is_read": false,
657
+ "is_sent": false
658
+ },
659
+ {
660
+ "notification_id": 1000001127,
661
+ "type": "OfferedSurrender",
662
+ "sender_id": 2902,
663
+ "sender_type": "corporation",
664
+ "timestamp": "2019-11-18 20:00:00",
665
+ "text": "charID: 1001\nentityID: 3001\niskValue: 100000000.0\nofferedID: 2001",
666
+ "is_read": false,
667
+ "is_sent": false
668
+ },
669
+ {
670
+ "notification_id": 1000001128,
671
+ "type": "OfferedToAlly",
672
+ "sender_id": 2902,
673
+ "sender_type": "corporation",
674
+ "timestamp": "2019-11-18 20:00:00",
675
+ "text": "aggressorID: 3011\ncharID: 1001\ndefenderID: 3001\nenemyID: 3011\niskValue: 0.0\nmercID: 2001",
676
+ "is_read": false,
677
+ "is_sent": false
678
+ },
679
+ {
680
+ "notification_id": 1000001129,
681
+ "type": "AllWarCorpJoinedAllianceMsg",
682
+ "sender_id": 2902,
683
+ "sender_type": "corporation",
684
+ "timestamp": "2019-11-18 20:00:00",
685
+ "text": "allianceID: 3001\ncorpID: 2001",
686
+ "is_read": false,
687
+ "is_sent": false
688
+ },
689
+ {
690
+ "notification_id": 1000001130,
691
+ "type": "AllWarSurrenderMsg",
692
+ "sender_id": 2902,
693
+ "sender_type": "corporation",
694
+ "timestamp": "2019-11-18 20:00:00",
695
+ "text": "againstID: 3011\ncost: null\ndeclaredByID: 2001\ndelayHours: null\nhostileState: null",
696
+ "is_read": false,
697
+ "is_sent": false
698
+ },
699
+ {
700
+ "notification_id": 1000001102,
701
+ "type": "CorpAllBillMsg",
702
+ "sender_id": 2902,
703
+ "sender_type": "corporation",
704
+ "timestamp": "2019-11-18 20:00:00",
705
+ "text": "amount: 6000000\nbillTypeID: 5\ncreditorID: 2011\ncurrentDate: 133462502887835953\ndebtorID: 2001\ndueDate: 133488422887817240\nexternalID: 3001\nexternalID2: -1",
706
+ "is_read": false,
707
+ "is_sent": false
708
+ },
709
+ {
710
+ "notification_id": 1000001103,
711
+ "type": "CharAppRejectMsg",
712
+ "sender_id": 2902,
713
+ "sender_type": "corporation",
714
+ "timestamp": "2019-11-18 20:00:00",
715
+ "text": "applicationText: ''\ncharID: 1011\ncorpID: 2001",
716
+ "is_read": false,
717
+ "is_sent": false
718
+ },
719
+ {
720
+ "notification_id": 1000001110,
721
+ "type": "CorporationGoalCreated",
722
+ "sender_id": 2001,
723
+ "sender_type": "corporation",
724
+ "timestamp": "2019-11-18 20:00:00",
725
+ "text": "corporation_id: 2001\ncreator_id: 1001\ngoal_id: 24595525861100907652819857792401564217\ngoal_name: Stratios For the Grandmaster",
726
+ "is_read": false,
727
+ "is_sent": false
728
+ },
729
+ {
730
+ "notification_id": 1000001111,
731
+ "type": "CorporationGoalCompleted",
732
+ "sender_id": 2001,
733
+ "sender_type": "corporation",
734
+ "timestamp": "2019-11-18 20:00:00",
735
+ "text": "corporation_id: 2001\ncreator_id: 1001\ngoal_id: 24595525861100907652819857792401564217\ngoal_name: Stratios For the Grandmaster",
736
+ "is_read": false,
737
+ "is_sent": false
738
+ },
739
+ {
740
+ "notification_id": 1999999999,
741
+ "type": "UnknownNotificationType",
742
+ "sender_id": 2001,
743
+ "sender_type": "corporation",
744
+ "timestamp": "2019-11-18 20:00:00",
745
+ "text": "",
746
+ "is_read": false,
747
+ "is_sent": false
598
748
  }
599
749
  ]
600
750
  }
@@ -1,4 +1,5 @@
1
1
  """functions for loading test data and for building mocks"""
2
+
2
3
  import datetime as dt
3
4
  import json
4
5
  import logging
@@ -11,7 +11,8 @@ from .utils import json_response_to_dict
11
11
 
12
12
  class TestPocoListDataView(NoSocketsTestCase):
13
13
  @classmethod
14
- def setUpTestData(cls):
14
+ def setUpClass(cls):
15
+ super().setUpClass()
15
16
  cls.factory = RequestFactory()
16
17
  load_eveuniverse()
17
18
  cls.user = UserMainBasicFactory()
@@ -19,7 +19,8 @@ from .utils import json_response_to_dict
19
19
 
20
20
  class TestStatistics(TestCase):
21
21
  @classmethod
22
- def setUpTestData(cls):
22
+ def setUpClass(cls):
23
+ super().setUpClass()
23
24
  cls.factory = RequestFactory()
24
25
  load_eveuniverse()
25
26
  alliance = EveAllianceInfoFactory(
@@ -36,7 +36,8 @@ OWNERS_PATH = "structures.models.owners"
36
36
  @patch(VIEWS_PATH + ".STRUCTURES_DEFAULT_TAGS_FILTER_ENABLED", False)
37
37
  class TestIndexRedirect(TestCase):
38
38
  @classmethod
39
- def setUpTestData(cls):
39
+ def setUpClass(cls):
40
+ super().setUpClass()
40
41
  cls.factory = RequestFactory()
41
42
 
42
43
  def test_should_redirect_to_public_view(self):
@@ -106,7 +107,8 @@ class TestIndexRedirect(TestCase):
106
107
 
107
108
  class TestIndexTagFilter(TestCase):
108
109
  @classmethod
109
- def setUpTestData(cls):
110
+ def setUpClass(cls):
111
+ super().setUpClass()
110
112
  cls.factory = RequestFactory()
111
113
  StructureTagFactory(name="tag_a", is_default=True)
112
114
  cls.user = UserMainDefaultFactory()
@@ -136,7 +138,8 @@ class TestIndexTagFilter(TestCase):
136
138
 
137
139
  class TestStructureListDataFilterVariant(TestCase):
138
140
  @classmethod
139
- def setUpTestData(cls):
141
+ def setUpClass(cls):
142
+ super().setUpClass()
140
143
  cls.factory = RequestFactory()
141
144
  load_eveuniverse()
142
145
  cls.user = UserMainDefaultFactory()
@@ -233,7 +236,8 @@ class TestStructureListDataFilterVariant(TestCase):
233
236
 
234
237
  class TestStructureListDataPermissions(TestCase):
235
238
  @classmethod
236
- def setUpTestData(cls):
239
+ def setUpClass(cls):
240
+ super().setUpClass()
237
241
  cls.factory = RequestFactory()
238
242
  load_eveuniverse()
239
243
 
@@ -303,7 +307,8 @@ class TestStructureListDataPermissions(TestCase):
303
307
 
304
308
  class TestStructureListTagFilters(TestCase):
305
309
  @classmethod
306
- def setUpTestData(cls):
310
+ def setUpClass(cls):
311
+ super().setUpClass()
307
312
  load_eveuniverse()
308
313
  cls.factory = RequestFactory()
309
314
  cls.user = UserMainDefaultFactory()
@@ -409,7 +414,8 @@ class TestStructureListTagFilters(TestCase):
409
414
 
410
415
  class TestStructurePowerModes(TestCase):
411
416
  @classmethod
412
- def setUpTestData(cls):
417
+ def setUpClass(cls):
418
+ super().setUpClass()
413
419
  cls.factory = RequestFactory()
414
420
  load_eveuniverse()
415
421
  cls.user = UserMainDefaultOwnerFactory()
@@ -515,7 +521,8 @@ class TestStructurePowerModes(TestCase):
515
521
 
516
522
  class TestAddStructureOwner(TestCase):
517
523
  @classmethod
518
- def setUpTestData(cls):
524
+ def setUpClass(cls):
525
+ super().setUpClass()
519
526
  cls.factory = RequestFactory()
520
527
  load_eveuniverse()
521
528
  cls.user = UserMainDefaultOwnerFactory()
@@ -651,7 +658,8 @@ class TestAddStructureOwner(TestCase):
651
658
 
652
659
  class TestStatus(TestCase):
653
660
  @classmethod
654
- def setUpTestData(cls):
661
+ def setUpClass(cls):
662
+ super().setUpClass()
655
663
  cls.factory = RequestFactory()
656
664
  # Owner.objects.filter(is_included_in_service_status=True)
657
665
 
@@ -732,7 +740,8 @@ class TestStatus(TestCase):
732
740
 
733
741
  class TestStructureFittingModal(TestCase):
734
742
  @classmethod
735
- def setUpTestData(cls):
743
+ def setUpClass(cls):
744
+ super().setUpClass()
736
745
  cls.factory = RequestFactory()
737
746
  load_eveuniverse()
738
747
  cls.character = EveCharacterFactory()
@@ -775,7 +784,8 @@ class TestStructureFittingModal(TestCase):
775
784
 
776
785
  class TestDetailsModal(TestCase):
777
786
  @classmethod
778
- def setUpTestData(cls):
787
+ def setUpClass(cls):
788
+ super().setUpClass()
779
789
  cls.factory = RequestFactory()
780
790
  load_eveuniverse()
781
791
  cls.user = UserMainDefaultFactory()