From 4ec8bc5de0a8b52faf2e4e4e86cce123646410b2 Mon Sep 17 00:00:00 2001 From: Asif Saifuddin Auvi Date: Wed, 23 Nov 2016 18:27:51 +0600 Subject: [PATCH] converted test_viewsets to pytest style --- tests/test_viewsets.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_viewsets.py b/tests/test_viewsets.py index 0d9b6b310..8e2539ecf 100644 --- a/tests/test_viewsets.py +++ b/tests/test_viewsets.py @@ -21,15 +21,15 @@ class InitializeViewSetsTestCase(TestCase): }) response = my_view(request) - self.assertEqual(response.status_code, status.HTTP_200_OK) - self.assertEqual(response.data, {'ACTION': 'LIST'}) + assert response.status_code == status.HTTP_200_OK + assert response.data == {'ACTION': 'LIST'} def test_initialize_view_set_with_empty_actions(self): try: BasicViewSet.as_view() except TypeError as e: - self.assertEqual(str(e), "The `actions` argument must be provided " - "when calling `.as_view()` on a ViewSet. " - "For example `.as_view({'get': 'list'})`") + assert str(e) == "The `actions` argument must be provided " + "when calling `.as_view()` on a ViewSet. " + "For example `.as_view({'get': 'list'})`" else: self.fail("actions must not be empty.")