def test_get_mapping(self):
        field = TextField()

        expected_type = 'string' if ES_MAJOR_VERSION == 2 else 'text'

        self.assertEqual({
            'type': expected_type,
        }, field.to_dict())
        def test_get_mapping(self):
            field = TextField()

            self.assertEqual({
                'type': 'text',
            }, field.to_dict())