Browse Source

Muda condição para verificar a instancia do campo

pull/285/merge
Eduardo Edson Batista Cordeiro Alves 9 years ago
parent
commit
ec469fd6e6
  1. 5
      sapl/test_general.py

5
sapl/test_general.py

@ -1,4 +1,5 @@
import pytest import pytest
from django.db.models import CharField, TextField
from django.apps import apps from django.apps import apps
from model_mommy import mommy from model_mommy import mommy
@ -6,12 +7,12 @@ from .settings import SAPL_APPS
pytestmark = pytest.mark.django_db pytestmark = pytest.mark.django_db
def test_charfiled_textfield(): def test_charfiled_textfield():
for model in apps.get_models(): for model in apps.get_models():
fields = model._meta.local_fields fields = model._meta.local_fields
for field in fields: for field in fields:
if (type(field).__name__ == 'CharField' or if isinstance(field, (CharField, TextField)):
type(field).__name__ == 'TextField'):
msg = 'Model = %s || Field = %s - %s - %s' % ( msg = 'Model = %s || Field = %s - %s - %s' % (
model.__name__, model.__name__,
field.attname, field.attname,

Loading…
Cancel
Save