def test_method_field(self):
        class TestSerializer(serializers.ModelSerializer):
            class Meta:
                model = RegularFieldsModel
                fields = ('auto_field', 'method')

        expected = dedent("""
            TestSerializer():
                auto_field = IntegerField(read_only=True)
                method = ReadOnlyField()
        """)
        self.assertEqual(repr(TestSerializer()), expected)
Test if a foreign key column is orderable.
dataset/ETHPy150Open tomchristie/django-rest-framework/tests/test_model_serializer.py/TestRegularFieldMappings.test_method_field--crossover with--dataset/ETHPy150Open Pegase745/sqlalchemy-datatables/tests/test_datatables_legacy.py/DataTablesLegacyTest.test_column_ordering_relation