      def stored_messages_count(self, storage, response):
          return stored_cookie_messages_count(storage, response)
  
      def test_get(self):
          storage = self.storage_class(self.get_request())
          # Set initial data.
          example_messages = ['test', 'me']
          set_cookie_data(storage, example_messages)
          # The message contains what's expected.
 
</s> remove         def encode_decode(data):
            message = Message(constants.DEBUG, data)
            encoded = storage._encode(message)
            decoded = storage._decode(encoded)
            return decoded.message
 </s> add         self.assertIsInstance(
            self.encode_decode(mark_safe('<b>Hello Django!</b>')).message,
            SafeData,
        )
        self.assertNotIsInstance(
            self.encode_decode('<b>Hello Django!</b>').message,
            SafeData,
        ) </s> remove             if obj.extra_tags:
 </s> add             if obj.extra_tags is not None:
    def encode_decode(self, *args, **kwargs):
        storage = self.get_storage()
        message = Message(constants.DEBUG, *args, **kwargs)
        encoded = storage._encode(message)
        return storage._decode(encoded)

      def stored_messages_count(self, storage, response):
          return stored_cookie_messages_count(storage, response)
  
    def encode_decode(self, *args, **kwargs):
        storage = self.get_storage()
        message = Message(constants.DEBUG, *args, **kwargs)
        encoded = storage._encode(message)
        return storage._decode(encoded)

      def test_get(self):
          storage = self.storage_class(self.get_request())
          # Set initial data.
          example_messages = ['test', 'me']
          set_cookie_data(storage, example_messages)
          # The message contains what's expected.
keep keep add keep keep keep keep keep keep
 Fixed #33458 -- Fixed encoding of messages with empty string as extra_tags. 
tests/messages_tests/test_cookie.py