title: Django Testing - access session in RequestFactory
body: <p>I am using <code>RequestFactory</code> in a Django test, and I can't find the right way to access the session variable, and I'm getting the following error when I try 
  <code>self.factory._session["zip_id"]</code> or <code>self.factory.session["zip_id"]</code>. </p>
  
  <pre><code>======================================================================
  ERROR: test_middleware (dj_geo.tests.IPToZipMiddleWareTest)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "c:\dj_site_test\dj_geo\tests.py", line 36, in test_middleware
      assert self.factory._session["zip_id"] != None
  AttributeError: 'RequestFactory' object has no attribute '_session'
  
  ----------------------------------------------------------------------
  
  
  
  @override_settings(MIDDLEWARE_CLASSES=(
      'dj_geo.middleware.IPToZipMiddleWare'
  ))
  class IPToZipMiddleWareTest(TestCase):
  
      def test_middleware(self):
          Zipcode.syncdb()
          assert Zipcode.objects.all().count() &gt; 0
  
          self.factory = RequestFactory()
          self.request = self.factory.get('/', {}, **{'REMOTE_ADDR':'108.31.178.99'})
          assert self.factory._session["zip_id"] != None
          assert self.factory._session["zip_id"] != ""
  </code></pre>