converted assertion to pytest style in test status (#8769)

This commit is contained in:
Asif Saif Uddin 2022-11-21 17:32:07 +06:00 committed by GitHub
parent 2a2b092864
commit 751808c59b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,27 +7,27 @@ from rest_framework.status import (
class TestStatus(TestCase): class TestStatus(TestCase):
def test_status_categories(self): def test_status_categories(self):
self.assertFalse(is_informational(99)) assert not is_informational(99)
self.assertTrue(is_informational(100)) assert is_informational(100)
self.assertTrue(is_informational(199)) assert is_informational(199)
self.assertFalse(is_informational(200)) assert not is_informational(200)
self.assertFalse(is_success(199)) assert not is_success(199)
self.assertTrue(is_success(200)) assert is_success(200)
self.assertTrue(is_success(299)) assert is_success(299)
self.assertFalse(is_success(300)) assert not is_success(300)
self.assertFalse(is_redirect(299)) assert not is_redirect(299)
self.assertTrue(is_redirect(300)) assert is_redirect(300)
self.assertTrue(is_redirect(399)) assert is_redirect(399)
self.assertFalse(is_redirect(400)) assert not is_redirect(400)
self.assertFalse(is_client_error(399)) assert not is_client_error(399)
self.assertTrue(is_client_error(400)) assert is_client_error(400)
self.assertTrue(is_client_error(499)) assert is_client_error(499)
self.assertFalse(is_client_error(500)) assert not is_client_error(500)
self.assertFalse(is_server_error(499)) assert not is_server_error(499)
self.assertTrue(is_server_error(500)) assert is_server_error(500)
self.assertTrue(is_server_error(599)) assert is_server_error(599)
self.assertFalse(is_server_error(600)) assert not is_server_error(600)