def read_attachment(self, attachment_id='', include_content=False):
        attachment = self.read(attachment_id)
        if not isinstance(attachment, Attachment):
            raise Inconsistent("Object in datastore must be Attachment, not %s" % type(attachment))

        if include_content:
            attachment.content = self.rr_store.read_attachment(attachment_id,
                                                               attachment_name=self.DEFAULT_ATTACHMENT_NAME)
            if attachment.attachment_type == AttachmentType.BLOB:
                if type(attachment.content) is not str:
                    raise BadRequest("Attachment content must be str")

        return attachment
UNIT test: services.accounts.utils - user ID and operations
dataset/ETHPy150Open ooici/pyon/pyon/ion/resregistry.py/ResourceRegistry.read_attachment--crossover with--dataset/ETHPy150Open satnet-project/server/services/accounts/tests/test_utils.py/UtilsTest.test_get_user_operations