From 88a910ebc85e191ace1f520d85645515ec5cb66c Mon Sep 17 00:00:00 2001 From: Asif Saifuddin Auvi Date: Wed, 4 Jan 2017 18:58:01 +0600 Subject: [PATCH] converted negotiation tests asserts to pytest --- tests/test_negotiation.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_negotiation.py b/tests/test_negotiation.py index 96ef83eab..6b8fd5060 100644 --- a/tests/test_negotiation.py +++ b/tests/test_negotiation.py @@ -38,20 +38,20 @@ class TestAcceptedMediaType(TestCase): def test_client_without_accept_use_renderer(self): request = Request(factory.get('/')) accepted_renderer, accepted_media_type = self.select_renderer(request) - self.assertEqual(accepted_media_type, 'application/json') + assert accepted_media_type == 'application/json' def test_client_underspecifies_accept_use_renderer(self): request = Request(factory.get('/', HTTP_ACCEPT='*/*')) accepted_renderer, accepted_media_type = self.select_renderer(request) - self.assertEqual(accepted_media_type, 'application/json') + assert accepted_media_type == 'application/json' def test_client_overspecifies_accept_use_client(self): request = Request(factory.get('/', HTTP_ACCEPT='application/json; indent=8')) accepted_renderer, accepted_media_type = self.select_renderer(request) - self.assertEqual(accepted_media_type, 'application/json; indent=8') + assert accepted_media_type == 'application/json; indent=8' def test_client_specifies_parameter(self): request = Request(factory.get('/', HTTP_ACCEPT='application/openapi+json;version=2.0')) accepted_renderer, accepted_media_type = self.select_renderer(request) - self.assertEqual(accepted_media_type, 'application/openapi+json;version=2.0') - self.assertEqual(accepted_renderer.format, 'swagger') + assert accepted_media_type == 'application/openapi+json;version=2.0' + assert accepted_renderer.format == 'swagger'