'Tests that a message containing SafeData is keeping its safe status when
retrieved from the message storage.'

def test_safedata(self):

    def encode_decode(data):
        message = Message(constants.DEBUG, data)
        encoded = storage._encode(message)
        decoded = storage._decode(encoded)
        return decoded.message
    storage = self.get_storage()
    self.assertIsInstance(encode_decode(mark_safe('<b>Hello    Django!</b>')), SafeData)
    self.assertNotIsInstance(encode_decode('<b>Hello    Django!</b>'), SafeData)
