From efca5f6feccf72421577ccea8889c7de729c47b8 Mon Sep 17 00:00:00 2001 From: Nikolaus Schlemm Date: Sun, 19 May 2013 14:54:16 +0200 Subject: [PATCH 1/2] use double quotes for docstring instead of single quotes --- rest_framework/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest_framework/views.py b/rest_framework/views.py index c9d55c18e..be64a8d0e 100644 --- a/rest_framework/views.py +++ b/rest_framework/views.py @@ -65,9 +65,9 @@ class APIView(View): return content def _generate_action_metadata(self, request): - ''' + """ Helper for generating the fields metadata for allowed and permitted methods. - ''' + """ actions = {} for method in self.allowed_methods: From 31893cff745b8cb62c3cc98b7103af2860eca319 Mon Sep 17 00:00:00 2001 From: Nikolaus Schlemm Date: Sun, 19 May 2013 15:12:01 +0200 Subject: [PATCH 2/2] * make test assertion more explicit * cleanup --- rest_framework/tests/fields.py | 2 +- rest_framework/tests/views.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/rest_framework/tests/fields.py b/rest_framework/tests/fields.py index 6bc37db28..d0b352413 100644 --- a/rest_framework/tests/fields.py +++ b/rest_framework/tests/fields.py @@ -846,7 +846,7 @@ class HumanizedFieldType(TestCase): """ self.assertIsInstance(humanized, unicode) - self.assertTrue(humanized) + self.assertNotEqual(humanized, '') class HumanizedField(TestCase): diff --git a/rest_framework/tests/views.py b/rest_framework/tests/views.py index b70ef4ae2..994cf6dc3 100644 --- a/rest_framework/tests/views.py +++ b/rest_framework/tests/views.py @@ -6,8 +6,6 @@ from rest_framework.decorators import api_view from rest_framework.response import Response from rest_framework.settings import api_settings from rest_framework.views import APIView -from rest_framework import exceptions -from rest_framework import serializers import copy factory = RequestFactory() @@ -100,4 +98,3 @@ class FunctionBasedViewIntegrationTests(TestCase): } self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual(sanitise_json_error(response.data), expected) -