aa-structures 2.9.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.
- {aa_structures-2.9.0.dist-info → aa_structures-2.9.1.dist-info}/METADATA +1 -1
- {aa_structures-2.9.0.dist-info → aa_structures-2.9.1.dist-info}/RECORD +7 -7
- structures/__init__.py +1 -1
- structures/models/owners.py +3 -1
- structures/tests/models/test_owners_1.py +20 -0
- {aa_structures-2.9.0.dist-info → aa_structures-2.9.1.dist-info}/LICENSE +0 -0
- {aa_structures-2.9.0.dist-info → aa_structures-2.9.1.dist-info}/WHEEL +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
structures/__init__.py,sha256=
|
1
|
+
structures/__init__.py,sha256=JDqVcTEi8eCaAdMSvOph_y7iv7PQbntaqVFeo0pFNS0,203
|
2
2
|
structures/admin.py,sha256=cn6AtcSDI6bJROhBnvE2iQwOkm1t3NVabrpTVphxbTk,38662
|
3
3
|
structures/app_settings.py,sha256=7BFWl1Q4tqTuj3CV6BmEctIFKJx9QIUfm2tjKzme2jM,6526
|
4
4
|
structures/apps.py,sha256=MNZH9l3qWCwuS7OGiKGkBVrDzKoOFlqwDdEgyEFzxVA,195
|
@@ -61,7 +61,7 @@ structures/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
|
|
61
61
|
structures/models/__init__.py,sha256=Da0-Z4BtsZ_mlnI6XtyvoE0UtTuOA0psGCuVhVPVKrM,916
|
62
62
|
structures/models/eveuniverse.py,sha256=vTIfzZL9guEDuZHQvRdG6pI4zSEdMqfVE-2SkHdqbRo,2213
|
63
63
|
structures/models/notifications.py,sha256=tznJo2prNjhk9C7S4cDrQxftIvuLcidB6vSkvFfb4mw,35146
|
64
|
-
structures/models/owners.py,sha256=
|
64
|
+
structures/models/owners.py,sha256=8tw8mR2ti9MpPs5ajeV5AONY53cvO5XnucrfIOQXEA4,53953
|
65
65
|
structures/models/structures_1.py,sha256=e1sI-2zMSKcPi2PyYA--fcc8rn-yQwODzlUHKjeWgLI,29778
|
66
66
|
structures/models/structures_2.py,sha256=g5Pct5jNmZC-n7fnpLs5UyiP9JLrGdI1vjYucHTV_wQ,10371
|
67
67
|
structures/static/structures/css/global.css,sha256=R4LEH9PwLoN77qkqBK7u2y_vzRC3fq8X_zKnAW7yhiA,1165
|
@@ -180,7 +180,7 @@ structures/tests/models/test_notifications_1.py,sha256=xVX4an54sZM8WLUdsAGUG2Nb4
|
|
180
180
|
structures/tests/models/test_notifications_2.py,sha256=wBoB6lHMK4yrd63DSkZ570yXW6coevDtI0pl1ttgB1o,31989
|
181
181
|
structures/tests/models/test_notifications_3.py,sha256=u11s0k9EmtFgL3kyb4zDyLVliQLOps701ZgEA2T2i0Y,7257
|
182
182
|
structures/tests/models/test_notifications_discord.py,sha256=9_42lcrb2lUUMRqgdRJAub9cJ4QZI71OyoORwK0LEvg,5551
|
183
|
-
structures/tests/models/test_owners_1.py,sha256=
|
183
|
+
structures/tests/models/test_owners_1.py,sha256=Xpac4P0xpJUmU8Jz5Ebxu0oSvhGcaW9a6UI7Jxhgmz4,22600
|
184
184
|
structures/tests/models/test_owners_2.py,sha256=gkTXpSibPWs1XfZtPvyeEvVebyYZcKERD9GQSYSClYk,21911
|
185
185
|
structures/tests/models/test_owners_3.py,sha256=cpDkfFkVvC1v4uuXha1vGUmWZ163huYTUDuZyed9Rdc,16947
|
186
186
|
structures/tests/models/test_owners_4.py,sha256=1tLHxeQTE4RacEdckwwQCocWyy0tVYuDDrHnHtQTNlA,18831
|
@@ -216,7 +216,7 @@ structures/webhooks/models.py,sha256=kUkt9rnRQIJIrU9Bjcs34rvkb-TMbUubHdn-kny08kI
|
|
216
216
|
structures/webhooks/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
217
217
|
structures/webhooks/tests/test_core.py,sha256=4NcEAQgK2KhQkFOxYh2ad0S-qUWh1DNGDmLo5Mo5opI,6762
|
218
218
|
structures/webhooks/tests/test_utils.py,sha256=ekADFv0JOEtXeqdiejbeqrABO__Q1flJHzVieQ7L9e0,459
|
219
|
-
aa_structures-2.9.
|
220
|
-
aa_structures-2.9.
|
221
|
-
aa_structures-2.9.
|
222
|
-
aa_structures-2.9.
|
219
|
+
aa_structures-2.9.1.dist-info/LICENSE,sha256=XZiwB_S_40_HhnvLg5xvtBb3g1oGjPrk0rpFwk8iInE,1070
|
220
|
+
aa_structures-2.9.1.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
221
|
+
aa_structures-2.9.1.dist-info/METADATA,sha256=yvzawtDxsWgorHAKcQRjx1WJFOc8GbVlvPQcYcL8q50,5971
|
222
|
+
aa_structures-2.9.1.dist-info/RECORD,,
|
structures/__init__.py
CHANGED
structures/models/owners.py
CHANGED
@@ -235,7 +235,9 @@ class Owner(models.Model):
|
|
235
235
|
is_alliance_main=False
|
236
236
|
)
|
237
237
|
if "update_fields" in kwargs:
|
238
|
-
kwargs["update_fields"]
|
238
|
+
u = set(kwargs["update_fields"])
|
239
|
+
u.add("is_alliance_main")
|
240
|
+
kwargs["update_fields"] = u
|
239
241
|
super().save(*args, **kwargs)
|
240
242
|
|
241
243
|
@property
|
@@ -190,6 +190,26 @@ class TestOwner(NoSocketsTestCase):
|
|
190
190
|
self.owner.refresh_from_db()
|
191
191
|
self.assertFalse(self.owner.is_alliance_main)
|
192
192
|
|
193
|
+
def test_should_ensure_is_alliance_main_is_set_for_update_fields_1(self):
|
194
|
+
# given
|
195
|
+
corporation = EveCorporationInfoFactory(alliance=self.alliance)
|
196
|
+
owner = OwnerFactory(corporation=corporation, is_alliance_main=True)
|
197
|
+
# when
|
198
|
+
owner.save(update_fields={"is_active"})
|
199
|
+
# then
|
200
|
+
owner.refresh_from_db()
|
201
|
+
self.assertTrue(owner.is_alliance_main)
|
202
|
+
|
203
|
+
def test_should_ensure_is_alliance_main_is_set_for_update_fields_2(self):
|
204
|
+
# given
|
205
|
+
corporation = EveCorporationInfoFactory(alliance=self.alliance)
|
206
|
+
owner = OwnerFactory(corporation=corporation, is_alliance_main=True)
|
207
|
+
# when
|
208
|
+
owner.save(update_fields=["is_active"])
|
209
|
+
# then
|
210
|
+
owner.refresh_from_db()
|
211
|
+
self.assertTrue(owner.is_alliance_main)
|
212
|
+
|
193
213
|
def test_should_allow_mains_from_other_alliances(self):
|
194
214
|
# given
|
195
215
|
self.owner.is_alliance_main = True
|
File without changes
|
File without changes
|