udata 10.0.2.dev32471__py2.py3-none-any.whl → 10.0.2.dev32490__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.
Potentially problematic release.
This version of udata might be problematic. Click here for more details.
- udata/core/badges/models.py +2 -1
- udata/core/badges/tests/test_model.py +8 -0
- {udata-10.0.2.dev32471.dist-info → udata-10.0.2.dev32490.dist-info}/METADATA +1 -1
- {udata-10.0.2.dev32471.dist-info → udata-10.0.2.dev32490.dist-info}/RECORD +8 -8
- {udata-10.0.2.dev32471.dist-info → udata-10.0.2.dev32490.dist-info}/LICENSE +0 -0
- {udata-10.0.2.dev32471.dist-info → udata-10.0.2.dev32490.dist-info}/WHEEL +0 -0
- {udata-10.0.2.dev32471.dist-info → udata-10.0.2.dev32490.dist-info}/entry_points.txt +0 -0
- {udata-10.0.2.dev32471.dist-info → udata-10.0.2.dev32490.dist-info}/top_level.txt +0 -0
udata/core/badges/models.py
CHANGED
|
@@ -83,5 +83,6 @@ class BadgeMixin:
|
|
|
83
83
|
|
|
84
84
|
def badge_label(self, badge):
|
|
85
85
|
"""Display the badge label for a given kind"""
|
|
86
|
-
|
|
86
|
+
badge_model = self._fields["badges"].field.document_type
|
|
87
|
+
kind = badge.kind if isinstance(badge, badge_model) else badge
|
|
87
88
|
return self.__badges__[kind]
|
|
@@ -170,3 +170,11 @@ class BadgeMixinTest(DBTestMixin, TestCase):
|
|
|
170
170
|
with self.assertRaises(db.ValidationError):
|
|
171
171
|
fake = FakeBadge(kind="doesnotexist")
|
|
172
172
|
fake.validate()
|
|
173
|
+
|
|
174
|
+
def test_badge_label(self):
|
|
175
|
+
"""Should return the label for a given badge."""
|
|
176
|
+
fake = Fake.objects.create()
|
|
177
|
+
fake.add_badge(TEST)
|
|
178
|
+
assert fake.badge_label(TEST) == "Test"
|
|
179
|
+
badge = fake.badges[0]
|
|
180
|
+
assert fake.badge_label(badge) == "Test"
|
|
@@ -66,13 +66,13 @@ udata/core/badges/commands.py,sha256=J6dKsoZmCbWM3HHOktPt-AHoMj-AhNPL0jxiV4yVlgw
|
|
|
66
66
|
udata/core/badges/factories.py,sha256=WLlEoPEYbT9HOwW-oWa8i4cgTKCa6-oOIp_Skaeyujo,304
|
|
67
67
|
udata/core/badges/fields.py,sha256=I_6APmd8AElTnzqCUa1rj0YR9IP3JgYd8lVtWScsghI,232
|
|
68
68
|
udata/core/badges/forms.py,sha256=ACTfmTJqwwEDRKMoXT4yV2oSq_fW_xpDE0vQLbntmOg,473
|
|
69
|
-
udata/core/badges/models.py,sha256=
|
|
69
|
+
udata/core/badges/models.py,sha256=JiJ-qMRcU7qsIcVzF-fI0s47Q0KXt8qNt80i4mi3wHA,3059
|
|
70
70
|
udata/core/badges/permissions.py,sha256=yY8vqonNJbQl4tUqpsJ-zhQqAMET6SGN37odrl3b2yI,550
|
|
71
71
|
udata/core/badges/signals.py,sha256=gD68zbdL-mM0epJp8MbkBhqcgqKd2_U-pEEUpwoII7w,237
|
|
72
72
|
udata/core/badges/tasks.py,sha256=gkp3gfXGb8-uqpb9U9P2aPz2Eb_g3Lol0K5IRsaJ2yg,432
|
|
73
73
|
udata/core/badges/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
74
|
udata/core/badges/tests/test_commands.py,sha256=dSM8VV9CByPJYv11BUlfh4WIV2KLy7GceBXJ0DFSKpY,1276
|
|
75
|
-
udata/core/badges/tests/test_model.py,sha256=
|
|
75
|
+
udata/core/badges/tests/test_model.py,sha256=hiCB4dxVlFclY41Dl5bDBIRBUSMg_OI-SHix1bsW8XU,5427
|
|
76
76
|
udata/core/contact_point/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
77
77
|
udata/core/contact_point/api.py,sha256=hK5fanw-QZvenqu2XQW5xKmhPNPGK6xplUWqaMy_Il4,1951
|
|
78
78
|
udata/core/contact_point/api_fields.py,sha256=IECdDFG9OzbQP8USXhUKAbEdVWiA6xO4ffcEB4zTTWQ,1073
|
|
@@ -705,9 +705,9 @@ udata/translations/pt/LC_MESSAGES/udata.mo,sha256=nGPoTSbeRlpCQGuxoJ7Oa650flpeeh
|
|
|
705
705
|
udata/translations/pt/LC_MESSAGES/udata.po,sha256=f-tilnngNNBEIQdXmm3GbdaLlvbwG9YLLwhqyRD5Lh4,44871
|
|
706
706
|
udata/translations/sr/LC_MESSAGES/udata.mo,sha256=8RL_aEe-0QJdgY-TNMy7bS4z8X9IOK8-C076dxcp3As,28163
|
|
707
707
|
udata/translations/sr/LC_MESSAGES/udata.po,sha256=Cp0bKPeIbuAqvFeoey_9ItQbAHIeiFZPnZLa6A6JNbI,51363
|
|
708
|
-
udata-10.0.2.
|
|
709
|
-
udata-10.0.2.
|
|
710
|
-
udata-10.0.2.
|
|
711
|
-
udata-10.0.2.
|
|
712
|
-
udata-10.0.2.
|
|
713
|
-
udata-10.0.2.
|
|
708
|
+
udata-10.0.2.dev32490.dist-info/LICENSE,sha256=V8j_M8nAz8PvAOZQocyRDX7keai8UJ9skgmnwqETmdY,34520
|
|
709
|
+
udata-10.0.2.dev32490.dist-info/METADATA,sha256=pqUbjD3PIbAbihK5fB7HDRNVMExovIU1pL9zxit_p7E,134672
|
|
710
|
+
udata-10.0.2.dev32490.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
|
|
711
|
+
udata-10.0.2.dev32490.dist-info/entry_points.txt,sha256=3SKiqVy4HUqxf6iWspgMqH8d88Htk6KoLbG1BU-UddQ,451
|
|
712
|
+
udata-10.0.2.dev32490.dist-info/top_level.txt,sha256=39OCg-VWFWOq4gCKnjKNu-s3OwFlZIu_dVH8Gl6ndHw,12
|
|
713
|
+
udata-10.0.2.dev32490.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|