diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 000000000..8655e4714 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,4 @@ +[run] +source=openslides +[report] +exclude_lines = def __(unicode|repr)__ diff --git a/.gitignore b/.gitignore index 6fa3cff77..d43bad4e2 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,7 @@ docs/_build/* build/* dist/* .DS_Store + +# Unit test / coverage reports +.coverage +htmlcov diff --git a/openslides/agenda/views.py b/openslides/agenda/views.py index 2c684bc95..55b42e204 100644 --- a/openslides/agenda/views.py +++ b/openslides/agenda/views.py @@ -27,7 +27,7 @@ from openslides.utils.utils import html_strong from openslides.projector.api import get_active_slide from openslides.projector.projector import Widget, SLIDE from .models import Item -from .agenda.forms import ItemOrderForm, ItemForm +from .forms import ItemOrderForm, ItemForm class Overview(TemplateView): diff --git a/openslides/global_settings.py b/openslides/global_settings.py index fd148ebe5..174d57d09 100644 --- a/openslides/global_settings.py +++ b/openslides/global_settings.py @@ -139,3 +139,6 @@ CACHES = { 'LOCATION': 'openslidecache' } } + +TEST_RUNNER = 'discover_runner.DiscoverRunner' +TEST_DISCOVER_TOP_LEVEL = os.path.dirname(os.path.dirname(__file__)) diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/openslides/agenda/tests.py b/tests/test_agenda.py similarity index 99% rename from openslides/agenda/tests.py rename to tests/test_agenda.py index 0e270b36d..4e8a32d1d 100644 --- a/openslides/agenda/tests.py +++ b/tests/test_agenda.py @@ -16,7 +16,7 @@ from django.db.models.query import EmptyQuerySet from openslides.projector.api import get_active_slide from openslides.participant.models import User -from .models import Item +from openslides.agenda.models import Item class ItemTest(TestCase): diff --git a/openslides/motion/tests.py b/tests/test_motion.py similarity index 100% rename from openslides/motion/tests.py rename to tests/test_motion.py diff --git a/openslides/participant/tests.py b/tests/test_participant.py similarity index 100% rename from openslides/participant/tests.py rename to tests/test_participant.py