diff --git a/rest_framework/tests/fields.py b/rest_framework/tests/fields.py index 3882b53f4..13df769f8 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 c0f42a068..2767d24c8 100644 --- a/rest_framework/tests/views.py +++ b/rest_framework/tests/views.py @@ -11,7 +11,6 @@ from rest_framework.response import Response from rest_framework.settings import api_settings from rest_framework.views import APIView - factory = RequestFactory() @@ -102,4 +101,3 @@ class FunctionBasedViewIntegrationTests(TestCase): } self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual(sanitise_json_error(response.data), expected) - diff --git a/rest_framework/views.py b/rest_framework/views.py index 1af4c0baa..1c4854f05 100644 --- a/rest_framework/views.py +++ b/rest_framework/views.py @@ -68,9 +68,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: # skip HEAD and OPTIONS