mirror of https://github.com/interlegis/sapl.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
586 B
20 lines
586 B
import pytest
|
|
from model_mommy import mommy
|
|
|
|
from .utils import appconfs
|
|
|
|
pytestmark = pytest.mark.django_db
|
|
|
|
|
|
def test_str_sanity():
|
|
# this simply a sanity check
|
|
# __str__ semantics is not considered and should be tested separetely
|
|
for app in appconfs:
|
|
for model in app.get_models():
|
|
obj = mommy.prepare(model)
|
|
try:
|
|
str(obj)
|
|
except Exception as exc:
|
|
msg = '%s.%s.__str__ is broken.' % (
|
|
model.__module__, model.__name__)
|
|
raise AssertionError(msg, exc) from exc
|
|
|