From cf0bd3981a1ff730175b07844fb37f8e85768f05 Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Wed, 10 Jun 2009 22:10:16 -0500 Subject: [PATCH] Moved the tests into their own project and make them pass :) --- .gitignore | 1 + .../tests/polls => test_project}/__init__.py | 0 test_project/manage.py | 11 +++++++++++ test_project/polls/__init__.py | 0 {test_utils/tests => test_project}/polls/admin.py | 0 .../polls/fixtures/polls_testmaker.json | 0 {test_utils/tests => test_project}/polls/models.py | 0 .../polls/templates/base.html | 0 .../polls/templates/polls/poll_detail.html | 0 .../polls/templates/polls/poll_list.html | 0 .../polls/templates/polls/results.html | 0 {test_utils/tests => test_project}/polls/urls.py | 0 {test_utils/tests => test_project}/polls/views.py | 0 {test_utils/tests => test_project}/settings.py | 14 +++++--------- test_project/test_app/__init__.py | 0 test_project/test_app/models.py | 3 +++ .../test_app}/tests/__init__.py | 3 ++- .../test_app}/tests/assertions_tests.py | 0 .../test_app}/tests/templatetags_tests.py | 0 .../test_app}/tests/testmaker_tests.py | 4 ++-- .../test_app}/tests/twill_tests.py | 0 21 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 .gitignore rename {test_utils/tests/polls => test_project}/__init__.py (100%) create mode 100755 test_project/manage.py create mode 100644 test_project/polls/__init__.py rename {test_utils/tests => test_project}/polls/admin.py (100%) rename {test_utils/tests => test_project}/polls/fixtures/polls_testmaker.json (100%) rename {test_utils/tests => test_project}/polls/models.py (100%) rename {test_utils/tests => test_project}/polls/templates/base.html (100%) rename {test_utils/tests => test_project}/polls/templates/polls/poll_detail.html (100%) rename {test_utils/tests => test_project}/polls/templates/polls/poll_list.html (100%) rename {test_utils/tests => test_project}/polls/templates/polls/results.html (100%) rename {test_utils/tests => test_project}/polls/urls.py (100%) rename {test_utils/tests => test_project}/polls/views.py (100%) rename {test_utils/tests => test_project}/settings.py (90%) create mode 100644 test_project/test_app/__init__.py create mode 100644 test_project/test_app/models.py rename {test_utils => test_project/test_app}/tests/__init__.py (99%) rename {test_utils => test_project/test_app}/tests/assertions_tests.py (100%) rename {test_utils => test_project/test_app}/tests/templatetags_tests.py (100%) rename {test_utils => test_project/test_app}/tests/testmaker_tests.py (86%) rename {test_utils => test_project/test_app}/tests/twill_tests.py (100%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0d20b64 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.pyc diff --git a/test_utils/tests/polls/__init__.py b/test_project/__init__.py similarity index 100% rename from test_utils/tests/polls/__init__.py rename to test_project/__init__.py diff --git a/test_project/manage.py b/test_project/manage.py new file mode 100755 index 0000000..008aeeb --- /dev/null +++ b/test_project/manage.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python +from django.core.management import execute_manager +try: + import settings # Assumed to be in the same directory. +except ImportError: + import sys + sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__) + sys.exit(1) + +if __name__ == "__main__": + execute_manager(settings) diff --git a/test_project/polls/__init__.py b/test_project/polls/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/test_utils/tests/polls/admin.py b/test_project/polls/admin.py similarity index 100% rename from test_utils/tests/polls/admin.py rename to test_project/polls/admin.py diff --git a/test_utils/tests/polls/fixtures/polls_testmaker.json b/test_project/polls/fixtures/polls_testmaker.json similarity index 100% rename from test_utils/tests/polls/fixtures/polls_testmaker.json rename to test_project/polls/fixtures/polls_testmaker.json diff --git a/test_utils/tests/polls/models.py b/test_project/polls/models.py similarity index 100% rename from test_utils/tests/polls/models.py rename to test_project/polls/models.py diff --git a/test_utils/tests/polls/templates/base.html b/test_project/polls/templates/base.html similarity index 100% rename from test_utils/tests/polls/templates/base.html rename to test_project/polls/templates/base.html diff --git a/test_utils/tests/polls/templates/polls/poll_detail.html b/test_project/polls/templates/polls/poll_detail.html similarity index 100% rename from test_utils/tests/polls/templates/polls/poll_detail.html rename to test_project/polls/templates/polls/poll_detail.html diff --git a/test_utils/tests/polls/templates/polls/poll_list.html b/test_project/polls/templates/polls/poll_list.html similarity index 100% rename from test_utils/tests/polls/templates/polls/poll_list.html rename to test_project/polls/templates/polls/poll_list.html diff --git a/test_utils/tests/polls/templates/polls/results.html b/test_project/polls/templates/polls/results.html similarity index 100% rename from test_utils/tests/polls/templates/polls/results.html rename to test_project/polls/templates/polls/results.html diff --git a/test_utils/tests/polls/urls.py b/test_project/polls/urls.py similarity index 100% rename from test_utils/tests/polls/urls.py rename to test_project/polls/urls.py diff --git a/test_utils/tests/polls/views.py b/test_project/polls/views.py similarity index 100% rename from test_utils/tests/polls/views.py rename to test_project/polls/views.py diff --git a/test_utils/tests/settings.py b/test_project/settings.py similarity index 90% rename from test_utils/tests/settings.py rename to test_project/settings.py index 116950c..3d8ac4f 100644 --- a/test_utils/tests/settings.py +++ b/test_project/settings.py @@ -6,9 +6,7 @@ DEBUG = False TEMPLATE_DEBUG = DEBUG -ADMINS = ( - # ('Eric', 'eric@ericholscher.com'), -) +ADMINS = () MANAGERS = ADMINS @@ -62,10 +60,10 @@ 'django.contrib.auth.middleware.AuthenticationMiddleware', ) -ROOT_URLCONF = 'test.urls' +ROOT_URLCONF = 'urls' TEMPLATE_DIRS = ( - '/Users/ericholscher/lib/test/templates', + os.path.join(PROJECT_DIR, 'templates') ) INSTALLED_APPS = ( @@ -74,8 +72,6 @@ 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', - 'django.contrib.admindocs', - 'test_utils.tests.polls', - 'test_utils', - 'django_extensions', + 'polls', + 'test_app', ) diff --git a/test_project/test_app/__init__.py b/test_project/test_app/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/test_project/test_app/models.py b/test_project/test_app/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/test_project/test_app/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/test_utils/tests/__init__.py b/test_project/test_app/tests/__init__.py similarity index 99% rename from test_utils/tests/__init__.py rename to test_project/test_app/tests/__init__.py index c3406f0..e5faf3d 100644 --- a/test_utils/tests/__init__.py +++ b/test_project/test_app/tests/__init__.py @@ -1,8 +1,9 @@ +from assertions_tests import * from templatetags_tests import * from testmaker_tests import * -from assertions_tests import * import twill_tests + __test__ = { 'TWILL': twill_tests, } diff --git a/test_utils/tests/assertions_tests.py b/test_project/test_app/tests/assertions_tests.py similarity index 100% rename from test_utils/tests/assertions_tests.py rename to test_project/test_app/tests/assertions_tests.py diff --git a/test_utils/tests/templatetags_tests.py b/test_project/test_app/tests/templatetags_tests.py similarity index 100% rename from test_utils/tests/templatetags_tests.py rename to test_project/test_app/tests/templatetags_tests.py diff --git a/test_utils/tests/testmaker_tests.py b/test_project/test_app/tests/testmaker_tests.py similarity index 86% rename from test_utils/tests/testmaker_tests.py rename to test_project/test_app/tests/testmaker_tests.py index d38b41b..1afd610 100644 --- a/test_utils/tests/testmaker_tests.py +++ b/test_project/test_app/tests/testmaker_tests.py @@ -14,7 +14,7 @@ class CrawlerTests(TestCase): Tests to test the Crawler API """ urls = "test_utils.tests.polls.urls" - fixtures = ['/Users/ericholscher/lib/django-test-utils/test_utils/tests/polls/fixtures/polls_testmaker.json'] + fixtures = ['polls_testmaker.json'] def test_basic_crawling(self): conf_urls = {} @@ -29,7 +29,7 @@ class TestMakerTests(TestCase): Tests to test basic testmaker functionality. """ urls = "test_utils.tests.polls.urls" - fixtures = ['/Users/ericholscher/lib/django-test-utils/test_utils/tests/polls/fixtures/polls_testmaker.json'] + fixtures = ['polls_testmaker.json'] def setUp(self): setup_logging('test_file', 'serialize_file') diff --git a/test_utils/tests/twill_tests.py b/test_project/test_app/tests/twill_tests.py similarity index 100% rename from test_utils/tests/twill_tests.py rename to test_project/test_app/tests/twill_tests.py