Browse Source

Muda forma que o assert é feito

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

8
sapl/test_general.py

@ -7,9 +7,12 @@ 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():
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)):
@ -18,13 +21,12 @@ def test_charfiled_textfield():
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)

Loading…
Cancel
Save