7171CM_ATTR_RICH_TEXT_CONTENT = "Rich Content"
7272CM_ATTR_RICH_TEXT_DESCRIPTION = "Rich Description"
7373
74+ CM_STRING_VS_RICH_TEXT = f"{ MODULE_NAME } _STR_RT"
75+ CM_ATTR_PLAIN_STRING = "Plain String"
76+ CM_ATTR_RICH_STRING = "Rich String"
77+
7478DQ_ENUM = f"{ MODULE_NAME } _DataQualityType"
7579DQ_TYPE_LIST = [
7680 "Accuracy" ,
@@ -201,6 +205,7 @@ def test_cm_ipr(cm_ipr: CustomMetadataDef, limit_attribute_applicability_kwargs)
201205 assert one_with_limited .description == ATTRIBUTE_DESCRIPTION
202206 assert one_with_limited .name != CM_ATTR_IPR_LICENSE
203207 assert one_with_limited .type_name == AtlanCustomAttributePrimitiveType .STRING .value
208+ assert one_with_limited .options .is_rich_text is False
204209 assert not one_with_limited .options .multi_value_select
205210 options = one_with_limited .options
206211 for attribute in limit_attribute_applicability_kwargs .keys ():
@@ -310,6 +315,7 @@ def test_cm_raci(
310315 assert one .name != CM_ATTR_RACI_ACCOUNTABLE
311316 assert one .type_name == AtlanCustomAttributePrimitiveType .STRING .value
312317 assert one .options
318+ assert one .options .is_rich_text is False
313319 assert not one .options .multi_value_select
314320 one = attributes [2 ]
315321 assert one .display_name == CM_ATTR_RACI_CONSULTED
@@ -330,6 +336,7 @@ def test_cm_raci(
330336 assert one .name != CM_ATTR_RACI_EXTRA
331337 assert one .type_name == AtlanCustomAttributePrimitiveType .STRING .value
332338 assert one .options
339+ assert one .options .is_rich_text is False
333340 assert not one .options .multi_value_select
334341
335342
@@ -578,6 +585,58 @@ def test_rich_text_cannot_be_multi_valued(client: AtlanClient):
578585 assert "ATLAN-PYTHON-400-076" in str (error )
579586
580587
588+ @pytest .fixture (scope = "module" )
589+ def cm_string_vs_rich_text (
590+ client : AtlanClient ,
591+ ) -> Generator [CustomMetadataDef , None , None ]:
592+ attribute_defs = [
593+ AttributeDef .create (
594+ client = client ,
595+ display_name = CM_ATTR_PLAIN_STRING ,
596+ attribute_type = AtlanCustomAttributePrimitiveType .STRING ,
597+ ),
598+ AttributeDef .create (
599+ client = client ,
600+ display_name = CM_ATTR_RICH_STRING ,
601+ attribute_type = AtlanCustomAttributePrimitiveType .RICH_TEXT ,
602+ ),
603+ ]
604+ cm = create_custom_metadata (
605+ client ,
606+ name = CM_STRING_VS_RICH_TEXT ,
607+ attribute_defs = attribute_defs ,
608+ logo = "🔤" ,
609+ locked = False ,
610+ )
611+ yield cm
612+ wait_for_successful_custometadatadef_purge (CM_STRING_VS_RICH_TEXT , client = client )
613+
614+
615+ def test_string_vs_rich_text (cm_string_vs_rich_text : CustomMetadataDef ):
616+ """Test that STRING and RICH_TEXT produce distinct CM attributes."""
617+ attributes = cm_string_vs_rich_text .attribute_defs
618+ assert attributes
619+ assert len (attributes ) == 2
620+
621+ # STRING attribute: is_rich_text must be False
622+ plain = attributes [0 ]
623+ assert plain .display_name == CM_ATTR_PLAIN_STRING
624+ assert plain .type_name == AtlanCustomAttributePrimitiveType .STRING .value
625+ assert plain .options
626+ assert plain .options .is_rich_text is False
627+ assert (
628+ plain .options .primitive_type == AtlanCustomAttributePrimitiveType .STRING .value
629+ )
630+
631+ # RICH_TEXT attribute: is_rich_text must be True
632+ rich = attributes [1 ]
633+ assert rich .display_name == CM_ATTR_RICH_STRING
634+ assert rich .type_name == AtlanCustomAttributePrimitiveType .STRING .value
635+ assert rich .options
636+ assert rich .options .is_rich_text is True
637+ assert rich .options .primitive_type == AtlanCustomAttributePrimitiveType .STRING .value
638+
639+
581640@pytest .fixture (scope = "module" )
582641def glossary (
583642 client : AtlanClient ,
0 commit comments