title: 'str' object has no attribute '_encode_json'
body: <p>I've been writing a test with RequestFactory to test one of my views, with the following code:</p>
  <pre><code>class ViewTestCase(TestCase):
  @classmethod
  def setUp(self):
      self.factory = RequestFactory
      self.user = User.objects.create_user(
          first_name='tester',
          username='test1', 
          password='123', 
          email='testuser@something.com'
          )
  
  def test_room_creation(self):
      payload = {&quot;titlePlanning&quot;: &quot;Test1&quot;,&quot;styleCards&quot;: &quot;Fibonnaci&quot;,&quot;deck&quot;: [&quot;1&quot;,&quot;2&quot;,&quot;3&quot;]}
      request = self.factory.post('/room', payload)
      request.user = self.user
      response = BeginRoom.as_view()(request)
      self.assertEqual(response.status_code, 200)
  </code></pre>
  <p>This is the data that I need to send to use POST:</p>
  <pre><code>class BeginRoom(APIView):
      permissions_classes = (IsAuthenticated,)
      def post(self, request, format=None):
      data= self.request.data
      user = request.user
      name = data['titlePlanning'].strip()
      styleCards = data['styleCards']
      cards = data['deck']
  </code></pre>
  <p>My problem is that whenever I run my tests I get the following error:</p>
  <pre><code>    data = self._encode_json({} if data is None else data, content_type)
   AttributeError: 'str' object has no attribute '_encode_json'
  </code></pre>
  <p>What should I do? I'm lost from here and can't find anything related. Any help is appreciated!</p>