mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 09:36:49 +03:00
Refactor schemas tests style
This commit is contained in:
parent
8fcb8d6350
commit
401ab54275
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue
Block a user