Commit 401ab542 by Artem Muterko

Refactor schemas tests style

parent 8fcb8d63
......@@ -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')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment