title: Set Django's RequestFactory() method to equal 'POST'
body: <p>Example view function:</p>
  
  <pre><code>def example_view(request):
      if request.method == "POST":
  
          print(request.session['Key'])
  
          return HttpResponse("Success")
  </code></pre>
  
  <p>Test case to test view:</p>
  
  <pre><code>from django.contrib.sessions.backends.db import SessionStore
  from django.test import RequestFactory, TestCase
  from website.views import example_view
  
  class ExampleTestCase(TestCase):
  
      def test_example(self):
  
          # Create request and session
          request = RequestFactory()
          request.session = SessionStore()
  
          request.session['Key'] = "Value"
  
          response = example_view(request)
  
          self.assertEquals(response.status_code, 200)
  </code></pre>
  
  <p>urls.py file in case anyone asks for it:</p>
  
  <pre><code>urlpatterns = [    
      path('example', views.example_view, name="example_view"),
  ]
  </code></pre>
  
  <p>Error Response: </p>
  
  <pre><code>AttributeError: 'RequestFactory' object has no attribute 'method'
  </code></pre>
  
  <p>Without:</p>
  
  <pre><code>if request.method == 'POST':
  </code></pre>
  
  <p>this works as expected. </p>
  
  <p>How do I set the request.method equal to post?</p>