          ])
          assert prefix == '/'
  
  
  class TestDescriptor(TestCase):
  
      def test_apiview_schema_descriptor(self):
          view = APIView()
          assert hasattr(view, 'schema')
          assert isinstance(view.schema, AutoSchema)
 
</s> remove     def test_manual_fields(self):
 </s> add     def test_update_fields(self):
        """
        That updating fields by-name helper is correct

        Recall: `update_fields(fields, update_with)`
        """
        schema = AutoSchema()
        fields = []

        # Adds a field...
        fields = schema.update_fields(fields, [
            coreapi.Field(
                "my_field",
                required=True,
                location="path",
                schema=coreschema.String()
            ),
        ])

        assert len(fields) == 1
        assert fields[0].name == "my_field"

        # Replaces a field...
        fields = schema.update_fields(fields, [
            coreapi.Field(
                "my_field",
                required=False,
                location="path",
                schema=coreschema.String()
            ),
        ])

        assert len(fields) == 1
        assert fields[0].required is False

    def test_get_manual_fields(self):
        """That get_manual_fields is applied during get_link""" </s> remove 
 </s> add         if manual_fields is None:
            manual_fields = [] </s> remove         if self._manual_fields is not None:
            by_name = {f.name: f for f in fields}
            for f in self._manual_fields:
                by_name[f.name] = f
            fields = list(by_name.values())
 </s> add         manual_fields = self.get_manual_fields(path, method)
        fields = self.update_fields(fields, manual_fields)
class TestAutoSchema(TestCase):
          ])
          assert prefix == '/'
  
  
class TestAutoSchema(TestCase):
  
      def test_apiview_schema_descriptor(self):
          view = APIView()
          assert hasattr(view, 'schema')
          assert isinstance(view.schema, AutoSchema)
keep keep keep keep replace keep keep keep keep keep
 Extract method for `manual_fields` processing (#5633)

* Extract method for `manual_fields` processing

Allows reuse of logic to replace Field instances in a field list by `Field.name`.

Adds a utility function for the logic plus a wrapper method on `AutoSchema`.

Closes #5632

* Manual fields suggestions (#2)

* Use OrderedDict in inspectors

* Move empty check to 'update_fields()'

* Make 'update_fields()' an AutoSchema staticmethod

* Add 'AutoSchema.get_manual_fields()'

* Conform '.get_manual_fields()' to other methods

* Add test for update_fields

* Make sure `manual_fields` is a list.

(As documented to be)

* Add docs for new AutoSchema methods.

* `get_manual_fields`
* `update_fields`

* Add release notes for PR. 
tests/test_schemas.py