code: def test_iter_attachments_mutation(self):
      # We had a bug where iter_attachments was mutating the list.
      m = self._make_message()
      m.set_content("arbitrary text as main part")
      m.add_related("more text as a related part")
      m.add_related('yet more text as a second "attachment"')
      orig = m.get_payload().copy()
      self.assertEqual(len(list(m.iter_attachments())), 2)
      self.assertEqual(m.get_payload(), orig)
  
imports: import unittest
  import textwrap
  from email import policy, message_from_string
  from email.message import EmailMessage, MIMEPart
  from test.test_email import TestEmailBase, parameterize
label_desc: Use image node_id 19 for calling the TestEmailMessageBase obj's underlying member method code with example usage: obj.test_iter_attachments_mutation() without return types