diff --git a/eox_tagging/test/test_models.py b/eox_tagging/test/test_models.py index 66d114c..d4709b9 100644 --- a/eox_tagging/test/test_models.py +++ b/eox_tagging/test/test_models.py @@ -106,7 +106,24 @@ def test_bad_field_config(self): @override_settings(EOX_TAGGING_DEFINITIONS=[]) def test_empty_setting(self): """ - Used to test saving without validisable = C0103, R0903, R0904, W0511, R0901lue": {"in": ["free", "private"]}, + Used to test saving without validations defined. + If the definitions array is empty then the tag cannot be created. + """ + with self.assertRaises(ValidationError): + Tag.objects.create_tag( + tag_value="example_tag_value", + tag_type="example_tag_1", + target_object=self.target_object, + owner_object=self.owner_object, + access=AccessLevel.PRIVATE, + ) + + @override_settings( + EOX_TAGGING_DEFINITIONS=[ + { + "tag_type": "subscription_tier", + "force_access": "private", + "validate_tag_value": {"in": ["free", "private"]}, "validate_owner_object": "User", "validate_target_object": "User", }, diff --git a/setup.cfg b/setup.cfg index f4f1a24..7a56f3d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -27,7 +27,7 @@ ignore = migrations,CVS max-line-length = 120 [pylint.messages_control] -disable = raise-missing-from, fixme, too-many-public-methods +disable = raise-missing-from, fixme, too-many-public-methods, too-few-public-methods [MESSAGES CONTROL] enable =