From d48f91f23f4b674502f5666143c761ad18b32ae6 Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Mon, 4 Apr 2016 11:53:03 -0300 Subject: [PATCH] =?UTF-8?q?Muda=20forma=20que=20o=20assert=20=C3=A9=20feit?= =?UTF-8?q?o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/test_general.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sapl/test_general.py b/sapl/test_general.py index 8c3093bc8..dac87ffa1 100644 --- a/sapl/test_general.py +++ b/sapl/test_general.py @@ -7,24 +7,26 @@ from .settings import SAPL_APPS pytestmark = pytest.mark.django_db +sapl_appconfs = [apps.get_app_config(n) for n in SAPL_APPS] + def test_charfiled_textfield(): - for model in apps.get_models(): - fields = model._meta.local_fields - for field in fields: + for app in sapl_appconfs: + for model in app.get_models(): + fields = model._meta.local_fields + for field in fields: if isinstance(field, (CharField, TextField)): msg = 'Model = %s || Field = %s - %s - %s' % ( model.__name__, field.attname, type(field).__name__, field.null) - raise AssertionError(msg) + assert not field.null, msg def test_str_sanity(): # this simply a sanity check # __str__ semantics is not considered and should be tested separetely - sapl_appconfs = [apps.get_app_config(n) for n in SAPL_APPS] for app in sapl_appconfs: for model in app.get_models(): obj = mommy.prepare(model)