Factor out the 'key fields without link_id' logic from document
Also make sure the to-be-removed is present before removing it when
doing the field reordening.
Patch by: Sverre Rabbelier
"""Django Unit Test and Doctest framework."""from django.test.client import Clientfrom django.test.testcases import TestCase