'Test that default discussion_id values are not exported.
Historically, the OLX format allowed omitting discussion ID values; in such case, the IDs are generated
deterministically based on the course ID and the usage ID. Moreover, Studio does not allow course authors
to edit discussion_id, so all courses authored in Studio have discussion_id omitted in OLX.
Forcing Studio to always export discussion_id can cause data loss when switching between an older and newer
export,  in a course with a course ID different from the one from which the export was created - because the
discussion ID would be different.'

def test_export_default_discussion_id(self):

    target_node = etree.Element('dummy')
    block = DiscussionXBlock(self.runtime_mock, scope_ids=self.keys, field_data=DictFieldData({}))
    discussion_id_field = block.fields['discussion_id']
    self.assertEqual(discussion_id_field._get_cached_value(block), NO_CACHE_VALUE)
    self.assertEqual(discussion_id_field.default, UNIQUE_ID)
    block.add_xml_to_node(target_node)
    self.assertEqual(target_node.tag, 'discussion')
    self.assertNotIn('discussion_id', target_node.attrib)
