          request = factory.post('/', data, format='json')
          response = self.view(request).render()
          self.assertEqual(response.status_code, status.HTTP_201_CREATED)
          created = self.objects.get(id=1)
          self.assertEqual(created.content, 'foobar')
  
  
  # Test for particularly ugly regression with m2m in browsable API
  class ClassB(models.Model):
      name = models.CharField(max_length=255)
 
</s> remove         self.assertEqual(response.status_code, status.HTTP_201_CREATED)
 </s> add         assert response.status_code == status.HTTP_201_CREATED </s> remove         self.assertEqual(response.status_code, status.HTTP_201_CREATED)
        self.assertEqual(response.data, {'id': 4, 'text': 'foobar'})
 </s> add         assert response.status_code == status.HTTP_201_CREATED
        assert response.data == {'id': 4, 'text': 'foobar'} </s> remove         self.assertEqual(response.status_code, status.HTTP_200_OK)
        self.assertEqual(response.data, self.data[0])
 </s> add         assert response.status_code == status.HTTP_200_OK
        assert response.data == self.data[0] </s> remove         self.assertEqual(created.text, 'foobar')
 </s> add         assert created.text == 'foobar' </s> remove         self.assertIn(expected_error, response.rendered_content.decode('utf-8'))
 </s> add         assert expected_error in response.rendered_content.decode('utf-8')
        assert created.content == 'foobar'
          request = factory.post('/', data, format='json')
          response = self.view(request).render()
          self.assertEqual(response.status_code, status.HTTP_201_CREATED)
          created = self.objects.get(id=1)
        assert created.content == 'foobar'
  
  
  # Test for particularly ugly regression with m2m in browsable API
  class ClassB(models.Model):
      name = models.CharField(max_length=255)
keep keep keep keep replace keep keep keep keep keep
 converted test asserts of generics-test to pytest 
tests/test_generics.py