From 2c68df1ae619ce64dfefe13e08eaacc0ad609b2a Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Mon, 25 Mar 2013 17:04:57 +0100 Subject: [PATCH] Moved tests to the toplevel. --- runtests.py | 14 +++++++------- {taggit/tests => tests}/__init__.py | 0 {taggit/tests => tests}/forms.py | 4 ++-- {taggit/tests => tests}/models.py | 0 {taggit/tests => tests}/tests.py | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) rename {taggit/tests => tests}/__init__.py (100%) rename {taggit/tests => tests}/forms.py (74%) rename {taggit/tests => tests}/models.py (100%) rename {taggit/tests => tests}/tests.py (98%) diff --git a/runtests.py b/runtests.py index 3e52cf18..a9140476 100755 --- a/runtests.py +++ b/runtests.py @@ -3,6 +3,8 @@ 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 @@ 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 74% rename from taggit/tests/forms.py rename to tests/forms.py index cb4020fc..1af1c273 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 98% rename from taggit/tests/tests.py rename to tests/tests.py index da8ca3dc..34b15c11 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 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)