docstr: Test MessageCache.add_message and has_message_reference
docstr_tok: ["Test","MessageCache.add_message","and","has_message_reference"]
code: def test_add_message(self):
      """Test MessageCache.add_message and has_message_reference"""
      cache = ForwardMsgCache()
      session = _create_mock_session()
      msg = create_dataframe_msg([1, 2, 3])
      cache.add_message(msg, session, 0)
  
      self.assertTrue(cache.has_message_reference(msg, session, 0))
      self.assertFalse(
          cache.has_message_reference(msg, _create_mock_session(), 0)
      )
  
imports: import unittest
  from unittest.mock import MagicMock
  from streamlit import config
  from streamlit.runtime import app_session
  from streamlit.runtime.forward_msg_cache import ForwardMsgCache, create_reference_msg, populate_hash_if_needed
  from streamlit.runtime.stats import CacheStat
  from streamlit.testing.v1.util import patch_config_options
  from tests.streamlit.message_mocks import create_dataframe_msg
label_desc: Use image node_id 4 for calling the ForwardMsgCacheTest obj's underlying member method code with example usage: obj.test_add_message() without return types