          request = factory.post('/view/')
          request.user = user
          response = view(request)
          expected = {'detail': 'CSRF Failed: CSRF cookie not set.'}
          self.assertEqual(response.status_code, 403)
          self.assertEqual(response.data, expected)
  
      def test_invalid_format(self):
          """
          Attempting to use a format that is not configured will raise an
          assertion error.
 
</s> remove         self.assertEqual(response.status_code, 403)
        self.assertEqual(response.data, expected)
 </s> add         assert response.status_code == 403
        assert response.data == expected </s> remove         self.assertEqual(response.status_code, 200)
 </s> add         assert response.status_code == 200 </s> remove         self.assertIsNotNone(response.redirect_chain)
        self.assertEqual(response.status_code, 200)
 </s> add         assert response.redirect_chain is not None
        assert response.status_code == 200 </s> remove         self.assertEqual(response.data['user'], 'example')
 </s> add         assert response.data['user'] == 'example' </s> remove         self.assertEqual(response.data['active_session'], False)
 </s> add         assert response.data['active_session'] is False
        assert response.status_code == 403
        assert response.data == expected
          request = factory.post('/view/')
          request.user = user
          response = view(request)
          expected = {'detail': 'CSRF Failed: CSRF cookie not set.'}
        assert response.status_code == 403
        assert response.data == expected
        assert response.status_code == 403
        assert response.data == expected
  
      def test_invalid_format(self):
          """
          Attempting to use a format that is not configured will raise an
          assertion error.
keep keep keep keep replace replace keep keep keep keep keep
 converted testing test asserts to pytest (#4949)

* converted testing test asserts to pytest

* moved 3rd arg from test_empty_post_uses_default_boolean_value test assert 
tests/test_testing.py