title: Unit testing a PUT method of the Django REST framework
body: <p>I'm trying to write tests for <code>APIviewSet</code>. GET and POST work fine, but I can not combine tests for the PUT method. I think that the problem has to do with the path I pass to the function, but I can not figure out how to fix it. I found nothing in the documentation.</p>
  
  <pre><code>class ResponseTracebackTestCase(TestCase):
  """class for traceback"""
  
  
  class JustTest(ResponseTracebackTestCase):
  
      maxDiff = None
  
      def setUp(self):
          # Every test needs access to the request factory.
          self.factory = APIRequestFactory()
          self.time = datetime.datetime(2010, 1, 1)
          self.user = User.objects.create_user(
              username='admin', email='admin@admin.com', password='top_secret1', born_date=self.time, date_joined=self.time)
          self.view = ClientViewSet.as_view({'get': 'list', 'post': 'create', 'put': 'update'})
  
      #...some_code
  
      def test_admin_update(self):
          request = self.factory.put('/api/service/client/', {...some_data})
          force_authenticate(request, user=self.user)
          response = self.view(request, pk=1)
          self.assertResponseCodeEquals(response, 200)
          response.render()
          self.assertEqual(json.loads(response.content), {...some_data})
  </code></pre>
  
  <p>Traceback:</p>
  
  <pre><code>  File "/code/service/tests.py", line 138, in test_admin_update
      self.assertResponseCodeEquals(response, 200)
    File "/code/service/tests.py", line 32, in assertResponseCodeEquals
      ) + '\n' + ''.join(format_list(response._init_stack))
  AssertionError: 404 != 200 : Response code was '404', expected '200'
  </code></pre>
  
  <p>response.detail:</p>
  
  <pre><code>{'detail': ErrorDetail(string='Not found.', code='not_found')}
  </code></pre>