Description

With the fix r7921 (thanks) I got past the immediate error on trying to run tests on 2.3, but hit a few more.

First the admin_scripts tests assume unittest.TestCase has an assertTrue method, but that doesn't exist in 2.3. Looking at the source it seems failUnless, which does exist in 2.3, is the same as assertTrue. Changing assertTrue to failUnless allows all the admin_scripts tests to run successfully on Python 2.3.

Second the regressiontests/utils/datastructures.py file attempts to work around the lack of sorted in 2.3 but the import is at the end of the file, which doesn't seem to work. Moving it to the top allows that test to run.

There are a couple of more failures running on 2.3 but they are unrelated to admin_scripts or sorted and I've run out of time for now so I figured I'd get these ones submitted and fixed first.

The second part of this patch is problematic. Yes, the tests pass if you move the import to the top of the page - that's because the datastructures test isn't running any more :-)

The current setup relies upon the fact that the datastructures module has a module docstring, which means there can't be any code preceeding the docstring. There are a few other ways to restructure this test (using imports or a test variable), but I don't have a version of Python 2.3 on hand to validate these potential fixes.

The second part of this patch is problematic. Yes, the tests pass if you move the import to the top of the page - that's because the datastructures test isn't running any more :-)

Ha! Oops.

The current setup relies upon the fact that the datastructures module has a module docstring, which means there can't be any code preceeding the docstring. There are a few other ways to restructure this test (using imports or a test variable), but I don't have a version of Python 2.3 on hand to validate these potential fixes.

Feel free to send me potential fixes and I can test them for you, since I went and got 2.3 for one of my boxes specifically to test Django on 2.3.

Confirmed fixed with r8057. To avoid confusion, might want to remove the sorted import attempt in tests/regressiontests/utils/datastructures.py, since it's really the one in tests/regressiontests/utils/tests.py that does the trick?