title: How to post a list with django-restframework testclient
body: <p>I am writing unit-tests for my api views. Right now I'm facing the problem that I cannot post lists using the <code>testclient</code> provided by <code>django-restframwork</code>:</p>
  
  <p>My view looks like this:</p>
  
  <pre><code>@detail_route(methods=['post'])
  def dosomestuff(self, request, slug, *args, **kwargs):
      watchlist = request.data.get('watchlist', [])
      sortedoutlist = request.data.get('sortedoutlist', [])
      # create some objects
      ...
  
      return Response('success'), status=status.HTTP_201_CREATED)
  </code></pre>
  
  <p>The json objects I post to this endpoint normally look like this:</p>
  
  <pre><code>{"watchlist": [32, 12, 23], "sortedoutlist": [1, 2,3 ]}
  </code></pre>
  
  <p>Now I set up a testcase for this view:</p>
  
  <pre><code>class MyTestCase(APITestCase):
  
      def test_dosomestuff(self):
          url = reverse('dosomestuff')
          data = {'watchlist': [32, 12, 23],
                  'sortedoutlist': [1, 2,3 ]}
          r = self.client.post(url, data)
          self.assertEqual(r.status_code, status.HTTP_201_CREATED)
  </code></pre>
  
  <p>The problem is that the <code>watchlist</code> and <code>sortedoutlist</code> recieved in the view are no <code>lists</code>, but <code>int</code> containing the last value of the sent list (watchlist is 23 and sortedoutlist is 3.  </p>
  
  <p>What am I doing wrong here? How can I post lists in the testcase?</p>