DEBUG = True
DATABASE_ENGINE = 'mysql' # 'postgresql', 'mysql', 'sqlite3'
or 'ado_mssql'.
DATABASE_NAME = 'test' # Or path to database file if using
sqlite3.
DATABASE_USER = 'root' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost.
Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not
used with sqlite3.
ROOT_URLCONF = None
Do these indicate something screwy with my setup, or do other 2.3.5
users also get these?
here's the test command and the full output:
DJANGO_SETTINGS_MODULE=test_django.settings PYTHONPATH=~/django-
trunk:~/test_django ./tests/runtests.py
======================================================================
ERROR: Request a page that is protected with @login, but use bad
credentials
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/andy/Projects/django-trunk/tests/modeltests/test_client/
models.py", line 101, in test_view_with_bad_login
self.assertFalse(response)
AttributeError: 'ClientTest' object has no attribute 'assertFalse'
======================================================================
ERROR: Doctest: regressiontests.forms.tests
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/andy/Projects/django-trunk/django/test/doctest.py",
line 2150, in runTest
failures, tries = runner.run(
File "/Users/andy/Projects/django-trunk/django/test/doctest.py",
line 1379, in run
return self.__run(test, compileflags, out)
File "/Users/andy/Projects/django-trunk/django/test/doctest.py",
line 1267, in __run
got += _exception_traceback(exc_info)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position
254: ordinal not in range(128)
======================================================================
FAIL: POST an empty dictionary to a view
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/andy/Projects/django-trunk/tests/modeltests/test_client/
models.py", line 53, in test_empty_post
self.assertEqual(response.status_code, 200)
File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
python2.3/unittest.py", line 302, in failUnlessEqual
raise self.failureException, \
AssertionError: 500 != 200
======================================================================
FAIL: GET a view that normally expects POSTs
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/andy/Projects/django-trunk/tests/modeltests/test_client/
models.py", line 45, in test_get_post_view
self.assertEqual(response.status_code, 200)
File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
python2.3/unittest.py", line 302, in failUnlessEqual
raise self.failureException, \
AssertionError: 500 != 200
======================================================================
FAIL: GET a view
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/andy/Projects/django-trunk/tests/modeltests/test_client/
models.py", line 35, in test_get_view
self.assertEqual(response.status_code, 200)
File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
python2.3/unittest.py", line 302, in failUnlessEqual
raise self.failureException, \
AssertionError: 500 != 200
======================================================================
FAIL: POST some data to a view
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/andy/Projects/django-trunk/tests/modeltests/test_client/
models.py", line 64, in test_post_view
self.assertEqual(response.status_code, 200)
File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
python2.3/unittest.py", line 302, in failUnlessEqual
raise self.failureException, \
AssertionError: 500 != 200
======================================================================
FAIL: GET a URL that redirects elsewhere
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/andy/Projects/django-trunk/tests/modeltests/test_client/
models.py", line 74, in test_redirect
self.assertEqual(response.status_code, 302)
File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
python2.3/unittest.py", line 302, in failUnlessEqual
raise self.failureException, \
AssertionError: 500 != 302
======================================================================
FAIL: GET an invalid URL
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/andy/Projects/django-trunk/tests/modeltests/test_client/
models.py", line 81, in test_unknown_page
self.assertEqual(response.status_code, 404)
File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
python2.3/unittest.py", line 302, in failUnlessEqual
raise self.failureException, \
AssertionError: 500 != 404
======================================================================
FAIL: Request a page that is protected with @login_required
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/andy/Projects/django-trunk/tests/modeltests/test_client/
models.py", line 88, in test_view_with_login
self.assertEqual(response.status_code, 302)
File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/
python2.3/unittest.py", line 302, in failUnlessEqual
raise self.failureException, \
AssertionError: 500 != 302
----------------------------------------------------------------------
Ran 68 tests in 6.718s
FAILED (failures=7, errors=2)
I've fixed the decorator usage in [4451] -- thanks for the heads up.
Jacob
And I was so used to decorators that I didn't even pick up on that!
A couple of tests use assertFalse / assertTrue which were introduced
to unittest in 2.4 also; these should be changed to failIf /
failUnless respectively.
I couldn't figure out why one widget's test was giving a
UnicodeDecodeError while other extremely similar tests weren't...