          )
          response = instance_view(request, pk='1')
          self.assertEqual(response.status_code, status.HTTP_200_OK)
          self.assertIn('actions', response.data)
          self.assertEqual(list(response.data['actions'].keys()), ['PUT'])
  
      def test_empty_view_does_not_assert(self):
          request = factory.get('/1', HTTP_AUTHORIZATION=self.permitted_credentials)
          response = empty_list_view(request, pk=1)
          self.assertEqual(response.status_code, status.HTTP_200_OK)
 
</s> remove         self.assertEqual(list(response.data['actions'].keys()), ['PUT'])
 </s> add         self.assertEqual(list(response.data['actions']), ['PUT']) </s> remove         self.assertEqual(list(response.data['actions'].keys()), ['POST'])
 </s> add         self.assertEqual(list(response.data['actions']), ['POST']) </s> remove         assert list(response.data['actions'].keys()) == ['PUT']
 </s> add         assert list(response.data['actions']) == ['PUT'] </s> remove         assert list(request.POST.keys()) == []
        assert list(request.FILES.keys()) == ['upload']
 </s> add         assert list(request.POST) == []
        assert list(request.FILES) == ['upload'] </s> remove         assert 'text' not in serializer.fields.keys()
 </s> add         assert 'text' not in serializer.fields
        self.assertEqual(list(response.data['actions']), ['PUT'])
          )
          response = instance_view(request, pk='1')
          self.assertEqual(response.status_code, status.HTTP_200_OK)
          self.assertIn('actions', response.data)
        self.assertEqual(list(response.data['actions']), ['PUT'])
  
      def test_empty_view_does_not_assert(self):
          request = factory.get('/1', HTTP_AUTHORIZATION=self.permitted_credentials)
          response = empty_list_view(request, pk=1)
          self.assertEqual(response.status_code, status.HTTP_200_OK)
keep keep keep keep replace keep keep keep keep keep
 Perfer iter(dict) over iter(dict.keys()) (#5736)

Calling dict.keys() is unnecessary. The two are functionally equivalent
on modern Pythons.

Inspired by Lennart Regebro's talk "Prehistoric Patterns in Python" from
PyCon 2017.

https://www.youtube.com/watch?v=V5-JH23Vk0I 
tests/test_permissions.py