diff --git a/runtests.py b/runtests.py index 3e52cf1..a914047 100755 --- a/runtests.py +++ b/runtests.py @@ -3,6 +3,8 @@ import os import sys from django.conf import settings +from django.core.management import execute_from_command_line + if not settings.configured: settings.configure( @@ -14,18 +16,16 @@ if not settings.configured: INSTALLED_APPS=[ 'django.contrib.contenttypes', 'taggit', - 'taggit.tests', + 'tests', ] ) -from django.test.simple import DjangoTestSuiteRunner - def runtests(): - runner = DjangoTestSuiteRunner() - failures = runner.run_tests(['tests'], verbosity=1, interactive=True) - sys.exit(failures) + argv = sys.argv[:1] + ['test'] + sys.argv[1:] + execute_from_command_line(argv) + if __name__ == '__main__': - runtests(*sys.argv[1:]) + runtests() diff --git a/taggit/tests/__init__.py b/tests/__init__.py similarity index 100% rename from taggit/tests/__init__.py rename to tests/__init__.py diff --git a/taggit/tests/forms.py b/tests/forms.py similarity index 86% rename from taggit/tests/forms.py rename to tests/forms.py index cb4020f..1af1c27 100644 --- a/taggit/tests/forms.py +++ b/tests/forms.py @@ -1,8 +1,8 @@ -from __future__ import unicode_literals +from __future__ import unicode_literals, absolute_import from django import forms -from taggit.tests.models import Food, DirectFood, CustomPKFood, OfficialFood +from .models import Food, DirectFood, CustomPKFood, OfficialFood class FoodForm(forms.ModelForm): diff --git a/taggit/tests/models.py b/tests/models.py similarity index 100% rename from taggit/tests/models.py rename to tests/models.py diff --git a/taggit/tests/tests.py b/tests/tests.py similarity index 99% rename from taggit/tests/tests.py rename to tests/tests.py index da8ca3d..34b15c1 100644 --- a/taggit/tests/tests.py +++ b/tests/tests.py @@ -1,4 +1,4 @@ -from __future__ import unicode_literals +from __future__ import unicode_literals, absolute_import from unittest import TestCase as UnitTestCase @@ -12,9 +12,9 @@ from django.utils.encoding import force_text from taggit.managers import TaggableManager from taggit.models import Tag, TaggedItem -from taggit.tests.forms import (FoodForm, DirectFoodForm, CustomPKFoodForm, +from .forms import (FoodForm, DirectFoodForm, CustomPKFoodForm, OfficialFoodForm) -from taggit.tests.models import (Food, Pet, HousePet, DirectFood, DirectPet, +from .models import (Food, Pet, HousePet, DirectFood, DirectPet, DirectHousePet, TaggedPet, CustomPKFood, CustomPKPet, CustomPKHousePet, TaggedCustomPKPet, OfficialFood, OfficialPet, OfficialHousePet, OfficialThroughModel, OfficialTag, Photo, Movie, Article)