I added some really basic manipulator unit tests in the magic-removal
branch, but one of them fails due to a *very* strange error. Somehow,
the _() global translation function is getting reassigned to a
dictionary. See the test output below.
The same code (from the unit tests) works fine in the interactive interpreter.
Adrian
Running tests with database 'postgresql'
'manipulators' module: API test raised an exception
===================================================
Code: "man.get_validation_errors(MultiValueDict({'name': ['Sallies
Fforth'], 'musician': ['foo']}))"
Line: 33
Exception: File
"/home/adrian/dev/django_src/django/branches/magic-removal/tests/doctest.py",
line 1243, in __run
compileflags, 1) in test.globs
File "<doctest manipulators[11]>", line 1, in ?
man.get_validation_errors(MultiValueDict({'name': ['Sallies
Fforth'], 'musician': ['foo']}))
File "/usr/lib/python2.4/site-packages/django/core/formfields.py",
line 71, in get_validation_errors
validator(new_data.get(field.field_name, ''), new_data)
File "/usr/lib/python2.4/site-packages/django/core/formfields.py",
line 438, in isValidChoice
raise validators.ValidationError, _("Select a valid choice;
'%(data)s' is not in %(choices)s.") % {'data': str_data, 'choices':
str_choices}
TypeError: 'dict' object is not callable
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org