          data = {'text': 'foobar'}
          request = factory.put('/1', data, format='json')
          with self.assertNumQueries(1):
              response = self.view(request, pk=1).render()
          self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
  
      def test_put_to_filtered_out_instance(self):
          """
          PUT requests to an URL of instance which is filtered out should not be
          able to create new objects.
 
</s> remove         self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
 </s> add         assert response.status_code == status.HTTP_404_NOT_FOUND </s> remove         self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
 </s> add         assert response.status_code == status.HTTP_404_NOT_FOUND </s> remove         self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
        self.assertFalse(self.objects.filter(id=999).exists())
 </s> add         assert response.status_code == status.HTTP_404_NOT_FOUND
        assert not self.objects.filter(id=999).exists() </s> remove         self.assertEqual(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)
        self.assertEqual(response.data, {"detail": 'Method "DELETE" not allowed.'})
 </s> add         assert response.status_code == status.HTTP_405_METHOD_NOT_ALLOWED
        assert response.data == {"detail": 'Method "DELETE" not allowed.'} </s> remove         self.assertEqual(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)
        self.assertEqual(response.data, {"detail": 'Method "POST" not allowed.'})
 </s> add         assert response.status_code == status.HTTP_405_METHOD_NOT_ALLOWED
        assert response.data == {"detail": 'Method "POST" not allowed.'}
        assert response.status_code == status.HTTP_404_NOT_FOUND
          data = {'text': 'foobar'}
          request = factory.put('/1', data, format='json')
          with self.assertNumQueries(1):
              response = self.view(request, pk=1).render()
        assert response.status_code == status.HTTP_404_NOT_FOUND
  
      def test_put_to_filtered_out_instance(self):
          """
          PUT requests to an URL of instance which is filtered out should not be
          able to create new objects.
keep keep keep keep replace keep keep keep keep keep
 converted test asserts of generics-test to pytest 
tests/test_generics.py