From 9628ae6c921f6c9bc6ef8e784b35203993f7f3cd Mon Sep 17 00:00:00 2001 From: Kevin Kubasik Date: Wed, 17 Jun 2009 01:27:20 +0000 Subject: [PATCH] [gsoc2009-testing] Creating a placeholder project for developing the windmill tests against. Also integrated the test_windmill command for the time being, although that needs discussion. git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/test-improvements@11015 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- .../core/management/commands/test_windmill.py | 102 ++++++++++++++++++ tests/runtests.py | 3 + tests/windmill_dev/__init__.py | 0 tests/windmill_dev/manage.py | 11 ++ tests/windmill_dev/settings.py | 83 ++++++++++++++ tests/windmill_dev/testapp/__init__.py | 0 tests/windmill_dev/testapp/models.py | 3 + tests/windmill_dev/testapp/tests.py | 32 ++++++ tests/windmill_dev/testapp/views.py | 1 + .../testapp/windmilltests/__init__.py | 12 +++ tests/windmill_dev/urls.py | 17 +++ 11 files changed, 264 insertions(+) create mode 100644 django/core/management/commands/test_windmill.py create mode 100755 tests/windmill_dev/__init__.py create mode 100755 tests/windmill_dev/manage.py create mode 100755 tests/windmill_dev/settings.py create mode 100644 tests/windmill_dev/testapp/__init__.py create mode 100644 tests/windmill_dev/testapp/models.py create mode 100644 tests/windmill_dev/testapp/tests.py create mode 100644 tests/windmill_dev/testapp/views.py create mode 100644 tests/windmill_dev/testapp/windmilltests/__init__.py create mode 100755 tests/windmill_dev/urls.py diff --git a/django/core/management/commands/test_windmill.py b/django/core/management/commands/test_windmill.py new file mode 100644 index 0000000000..d9b72f9c3e --- /dev/null +++ b/django/core/management/commands/test_windmill.py @@ -0,0 +1,102 @@ +from django.core.management.base import BaseCommand +from windmill.authoring import djangotest +import sys, os +from time import sleep +import types +import logging + +class ServerContainer(object): + start_test_server = djangotest.start_test_server + stop_test_server = djangotest.stop_test_server + +def attempt_import(name, suffix): + try: + mod = __import__(name+'.'+suffix) + except ImportError: + mod = None + if mod is not None: + s = name.split('.') + mod = __import__(s.pop(0)) + for x in s+[suffix]: + mod = getattr(mod, x) + return mod + +class Command(BaseCommand): + + help = "Run windmill tests. Specify a browser, if one is not passed Firefox will be used" + + args = '