'Tests that http_session correctly extracts a session cookie.'

def test_http_session(self):

    session1 = session_for_reply_channel(u'test-reply')
    message = Message({u'reply_channel': u'test-reply', u'http_version': u'1.1', u'method': u'GET', u'path': u'/test2/', u'headers': {u'host': 'example.com', u'cookie': (u'%s=%s' % (settings.SESSION_COOKIE_NAME, session1.session_key)).encode(u'ascii')}}, None, None)
    @http_session
    @http_session
    def inner(message):
        message.http_session[u'species'] = u'horse'
    inner(message)
    session2 = session_for_reply_channel(u'test-reply')
    self.assertEqual(session2[u'species'], u'horse')
