From ec469fd6e6c3d14787a52bc320b6d380fcce3863 Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Mon, 4 Apr 2016 11:09:52 -0300 Subject: [PATCH] =?UTF-8?q?Muda=20condi=C3=A7=C3=A3o=20para=20verificar=20?= =?UTF-8?q?a=20instancia=20do=20campo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/test_general.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sapl/test_general.py b/sapl/test_general.py index 090052e51..8c3093bc8 100644 --- a/sapl/test_general.py +++ b/sapl/test_general.py @@ -1,4 +1,5 @@ import pytest +from django.db.models import CharField, TextField from django.apps import apps from model_mommy import mommy @@ -6,12 +7,12 @@ from .settings import SAPL_APPS pytestmark = pytest.mark.django_db + def test_charfiled_textfield(): for model in apps.get_models(): fields = model._meta.local_fields for field in fields: - if (type(field).__name__ == 'CharField' or - type(field).__name__ == 'TextField'): + if isinstance(field, (CharField, TextField)): msg = 'Model = %s || Field = %s - %s - %s' % ( model.__name__, field.attname,