From 71490d422c3a5bbefd8fa5051b4aa80247130ed0 Mon Sep 17 00:00:00 2001 From: fivethreeo Date: Fri, 14 Jan 2011 14:52:45 +0100 Subject: [PATCH] added setup.py test/ todo: write tests --- setup.py | 2 + simple_translation/test/__init__.py | 0 simple_translation/test/run_tests.py | 55 +++++++++++++++++++++ simple_translation/test/testapp/__init__.py | 0 simple_translation/test/testapp/models.py | 0 simple_translation/test/testcases.py | 4 ++ simple_translation/tests.py | 6 +++ 7 files changed, 67 insertions(+) create mode 100644 simple_translation/test/__init__.py create mode 100644 simple_translation/test/run_tests.py create mode 100644 simple_translation/test/testapp/__init__.py create mode 100644 simple_translation/test/testapp/models.py create mode 100644 simple_translation/test/testcases.py create mode 100644 simple_translation/tests.py diff --git a/setup.py b/setup.py index 0a2bedd..ffdd18a 100644 --- a/setup.py +++ b/setup.py @@ -16,6 +16,8 @@ setup( 'Programming Language :: Python', 'Framework :: Django', ], + install_requires = ['Django>=1.2.4'], + test_suite = 'simple_translation.test.run_tests.run_tests', include_package_data=True, zip_safe=False, ) diff --git a/simple_translation/test/__init__.py b/simple_translation/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/simple_translation/test/run_tests.py b/simple_translation/test/run_tests.py new file mode 100644 index 0000000..0bfa384 --- /dev/null +++ b/simple_translation/test/run_tests.py @@ -0,0 +1,55 @@ +import sys + +def run_tests(): + + from django.conf import settings + + settings.configure( + DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': 'simple_translation.db' + } + }, + + TEMPLATE_CONTEXT_PROCESSORS = ( + "django.core.context_processors.auth", + "django.core.context_processors.i18n", + "django.core.context_processors.debug", + "django.core.context_processors.request", + "django.core.context_processors.media", + 'django.core.context_processors.csrf', + ), + + + MIDDLEWARE_CLASSES = ( + 'django.contrib.sessions.middleware.SessionMiddleware', + 'cms.middleware.multilingual.MultilingualURLMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.doc.XViewMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware' + ), + + ROOT_URLCONF = 'simple_translation.test.testapp.urls', + + INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.admin', + 'django.contrib.sites', + 'simple_translation' + ), + + LANGUAGE_CODE = "en", + + ) + + from django.test.utils import get_runner + + failures = get_runner(settings)().run_tests(['simple_translation']) + sys.exit(failures) + +if __name__ == '__main__': + run_tests() \ No newline at end of file diff --git a/simple_translation/test/testapp/__init__.py b/simple_translation/test/testapp/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/simple_translation/test/testapp/models.py b/simple_translation/test/testapp/models.py new file mode 100644 index 0000000..e69de29 diff --git a/simple_translation/test/testcases.py b/simple_translation/test/testcases.py new file mode 100644 index 0000000..0b7ece0 --- /dev/null +++ b/simple_translation/test/testcases.py @@ -0,0 +1,4 @@ +from django.test.testcases import TestCase + +class SimpleTranslationBaseTestCase(TestCase): + pass \ No newline at end of file diff --git a/simple_translation/tests.py b/simple_translation/tests.py new file mode 100644 index 0000000..e93468a --- /dev/null +++ b/simple_translation/tests.py @@ -0,0 +1,6 @@ +from simple_translation.test.testcases import SimpleTranslationBaseTestCase + +class SimpleTranslationTestCase(SimpleTranslationBaseTestCase): + + def test_01_test_urls(self): + self.assertEquals(True, False) \ No newline at end of file