From 401ab54275dc06c33815d54db0c3451ee5d884a9 Mon Sep 17 00:00:00 2001 From: Artem Muterko Date: Thu, 12 Jan 2017 18:33:24 +0200 Subject: [PATCH] Refactor schemas tests style --- tests/test_schemas.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/test_schemas.py b/tests/test_schemas.py index e196a1f61..99b87fc85 100644 --- a/tests/test_schemas.py +++ b/tests/test_schemas.py @@ -90,7 +90,7 @@ class TestRouterGeneratedSchema(TestCase): def test_anonymous_request(self): client = APIClient() response = client.get('/', HTTP_ACCEPT='application/coreapi+json') - self.assertEqual(response.status_code, 200) + assert response.status_code == 200 expected = coreapi.Document( url='', title='Example API', @@ -125,13 +125,13 @@ class TestRouterGeneratedSchema(TestCase): } } ) - self.assertEqual(response.data, expected) + assert response.data == expected def test_authenticated_request(self): client = APIClient() client.force_authenticate(MockUser()) response = client.get('/', HTTP_ACCEPT='application/coreapi+json') - self.assertEqual(response.status_code, 200) + assert response.status_code == 200 expected = coreapi.Document( url='', title='Example API', @@ -217,7 +217,7 @@ class TestRouterGeneratedSchema(TestCase): } } ) - self.assertEqual(response.data, expected) + assert response.data == expected class DenyAllUsingHttp404(permissions.BasePermission): @@ -312,7 +312,7 @@ class TestSchemaGenerator(TestCase): } } ) - self.assertEqual(schema, expected) + assert schema == expected @unittest.skipUnless(coreapi, 'coreapi is not installed') @@ -365,7 +365,7 @@ class TestSchemaGeneratorNotAtRoot(TestCase): } } ) - self.assertEqual(schema, expected) + assert schema == expected @unittest.skipUnless(coreapi, 'coreapi is not installed') @@ -400,7 +400,7 @@ class TestSchemaGeneratorWithRestrictedViewSets(TestCase): }, } ) - self.assertEqual(schema, expected) + assert schema == expected @unittest.skipUnless(coreapi, 'coreapi is not installed')