From 87607ad6b13e6a64e416b3d44804885fa171bdcf Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Mon, 4 Apr 2016 10:46:18 -0300 Subject: [PATCH] Cria teste para verificar campo null de CharField e TextField --- sapl/test_general.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sapl/test_general.py b/sapl/test_general.py index 443cc40d4..47a992aed 100644 --- a/sapl/test_general.py +++ b/sapl/test_general.py @@ -6,6 +6,18 @@ from .settings import SAPL_APPS pytestmark = pytest.mark.django_db +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'): + msg = 'Model = %s || Field = %s - %s - %s' % ( + model.__name__, + field.attname, + type(field).__name__, + field.null) + raise AssertionError(msg) + def test_str_sanity(): # this simply a sanity check