﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
7715	admin_tests failures when running Django tests in one natural fashion	Malcolm Tredinnick	nobody	"This may be a PEBCAK issue, but I can't see it.

I run the Django tests as follows
{{{
> cd django.git/tests
> ./runtests.py --settings=settings3.py
}}}
(etc).

The admin tests introduced in [7876] are showing 11 failures (from 83 tests) now. They are all failing in the same way:
{{{
#!python
File ""/usr/lib/python2.5/site-packages/django/core/management/__init__.py"", line 251, in setup_environ
    project_module = __import__(project_name, {}, {}, [''])
ImportError: No module named tests
}}}

Note that `site-packages/django/` is a symlink to my development codebase, so it is running the right code. I just don't want to have to mess around with `PYTHONPATH` settings all the time, so I use `site-packages` as Guido intended.

The `PYTHONPATH` modification set up in `run_test()` looks sensible when I print it out right after it's set.
{{{
/home/malcolm/BleedingEdge/Django/django.git/tests:/home/malcolm/BleedingEdge/Django/django.git
}}}
In fact, the full `sys.path` setting at the time of the problem looks pretty decent, too (I catch the import exception and dump this to a file, so this is the real value at the time of the crime):
{{{
['/home/malcolm/BleedingEdge/Django/django.git/tests/regressiontests', '/home/malcolm/BleedingEdge/Django/django.git/tests', '/home/malcolm/BleedingEdge/Django/django.git', '/usr/lib/python25.zip', '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages/Numeric', '/usr/lib/python2.5/site-packages/PIL', '/usr/lib/python2.5/site-packages/gst-0.10', '/usr/lib/python2.5/site-packages/gtk-2.0', '/home/malcolm/BleedingEdge/Django/django.git/tests/..']
}}}
This is all with a nice clean tree (nuked the .pyc files and everything not under source control) using [7882]. I am most confused, but don't really have time to debug it now, since this cropped up whilst checking something else. Maybe it's obvious and I'm not seeing it, but it's definitely repeatable."		closed	Testing framework	dev		fixed			Unreviewed	0	0	0	0	0	0
