'Confirms that, if the data exceeds what is allowed in a cookie,
messages which did not fit are stored in the SessionBackend.'

def test_session_fallback(self):

    storage = self.get_storage()
    response = self.get_response()
    msg_size = int((((CookieStorage.max_cookie_size - 54) / 4.5) - 37))
    for i in range(5):
        storage.add(constants.INFO, (str(i) * msg_size))
    storage.update(response)
    cookie_storing = self.stored_cookie_messages_count(storage, response)
    self.assertEqual(cookie_storing, 4)
    session_storing = self.stored_session_messages_count(storage, response)
    self.assertEqual(session_storing, 1)
