Changeset 1749 for trunk/pylucid_project/tests
- Timestamp:
- 09/09/08 14:55:25 (18 months ago)
- Files:
-
- 1 modified
-
trunk/pylucid_project/tests/__init__.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pylucid_project/tests/__init__.py
r1664 r1749 100 100 os.environ['DJANGO_SETTINGS_MODULE'] = "PyLucid.settings" 101 101 102 from django.test.utils import setup_test_environment, teardown_test_environment103 from django.test.utils import create_test_db, destroy_test_db104 105 102 from django.conf import settings 106 103 from django.db import connection 107 104 from django.core.cache import cache 108 105 from django.test import TestCase as DjangoTestCase 109 106 from django.contrib.auth.models import User, UNUSABLE_PASSWORD 107 from django.test.utils import setup_test_environment, teardown_test_environment 110 108 111 109 from tests.utils.BrowserDebug import debug_response … … 117 115 from PyLucid.models import Page, Style, Template, Plugin 118 116 from PyLucid.system.plugin_manager import auto_install_plugins, install_plugin 119 120 117 121 118 # Display invalid (e.g. misspelled, unused) template variables … … 533 530 def remove_unittest_plugin(): 534 531 print "remove unittest plugin (%s)" % TEST_PLUGIN_DST 535 shutil.rmtree(os.path.abspath(TEST_PLUGIN_DST)) 532 try: 533 shutil.rmtree(os.path.abspath(TEST_PLUGIN_DST)) 534 except Exception, err: 535 print "Error:", err 536 536 537 537 … … 742 742 """ 743 743 print "test start." 744 settings.DEBUG = False 744 settings.DEBUG = False 745 745 setup_test_environment() 746 746 old_name = settings.DATABASE_NAME 747 db_name = create_test_db(verbosity=1, autoclobber=not interactive) 747 db_name = connection.creation.create_test_db( 748 verbosity=1, autoclobber=not interactive 749 ) 750 print "Test database '%s' created" % db_name 748 751 init_pyluciddb(verbosity==2) 749 752 suite = get_tests(test_labels, verbosity==2) 750 753 print "Running tests" 751 754 result = unittest.TextTestRunner(verbosity=verbosity).run(suite) 752 destroy_test_db(old_name, verbosity)755 connection.creation.destroy_test_db(old_name, verbosity) 753 756 teardown_test_environment() 754 757 teardown_pylucid() … … 758 761 759 762 print "PyLucid unittest" 763 #run_tests(test_labels=["test_plugin_api",])