diff --git a/stix2/test/v21/test_language_content.py b/stix2/test/v21/test_language_content.py index 4f541e0..95adebc 100644 --- a/stix2/test/v21/test_language_content.py +++ b/stix2/test/v21/test_language_content.py @@ -71,3 +71,18 @@ def test_language_content_campaign(): # or https://docs.python.org/2/library/json.html#json.dumps assert lc.serialize(pretty=True, ensure_ascii=False) == TEST_LANGUAGE_CONTENT assert lc.modified == camp.modified + + +def test_object_modified_optional(): + """ + object_modified is now optional in STIX 2.1. + """ + + stix2.v21.LanguageContent( + object_ref=CAMPAIGN_ID, + contents={ + "en": { + "name": "the english text", + }, + }, + ) diff --git a/stix2/v21/common.py b/stix2/v21/common.py index f85bf88..70be5dc 100644 --- a/stix2/v21/common.py +++ b/stix2/v21/common.py @@ -79,7 +79,7 @@ class LanguageContent(_STIXBase): ('modified', TimestampProperty(default=lambda: NOW, precision='millisecond')), ('object_ref', ReferenceProperty(spec_version='2.1', required=True)), # TODO: 'object_modified' it MUST be an exact match for the modified time of the STIX Object (SRO or SDO) being referenced. - ('object_modified', TimestampProperty(required=True, precision='millisecond')), + ('object_modified', TimestampProperty(precision='millisecond')), # TODO: 'contents' https://docs.google.com/document/d/1ShNq4c3e1CkfANmD9O--mdZ5H0O_GLnjN28a_yrEaco/edit#heading=h.cfz5hcantmvx ('contents', DictionaryProperty(spec_version='2.1', required=True)), ('revoked', BooleanProperty()),