From 8ec57e6636c146d369148ad73ba6a6c4dbbc6368 Mon Sep 17 00:00:00 2001 From: Asif Saifuddin Auvi Date: Wed, 30 Nov 2016 13:19:55 +0600 Subject: [PATCH] converted test asserts of validation_errors to pytest --- tests/test_validation_error.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/test_validation_error.py b/tests/test_validation_error.py index 8e371a349..562fe37e6 100644 --- a/tests/test_validation_error.py +++ b/tests/test_validation_error.py @@ -54,16 +54,16 @@ class TestValidationErrorWithFullDetails(TestCase): request = factory.get('/', content_type='application/json') response = view(request) - self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) - self.assertEqual(response.data, self.expected_response_data) + assert response.status_code == status.HTTP_400_BAD_REQUEST + assert response.data == self.expected_response_data def test_function_based_view_exception_handler(self): view = error_view request = factory.get('/', content_type='application/json') response = view(request) - self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) - self.assertEqual(response.data, self.expected_response_data) + assert response.status_code == status.HTTP_400_BAD_REQUEST + assert response.data == self.expected_response_data class TestValidationErrorWithCodes(TestCase): @@ -89,13 +89,13 @@ class TestValidationErrorWithCodes(TestCase): request = factory.get('/', content_type='application/json') response = view(request) - self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) - self.assertEqual(response.data, self.expected_response_data) + assert response.status_code == status.HTTP_400_BAD_REQUEST + assert response.data == self.expected_response_data def test_function_based_view_exception_handler(self): view = error_view request = factory.get('/', content_type='application/json') response = view(request) - self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) - self.assertEqual(response.data, self.expected_response_data) + assert response.status_code == status.HTTP_400_BAD_REQUEST + assert response.data == self.expected_response_data