On Sat, Feb 23, 2008 at 9:43 AM, Ian Macdonald <[EMAIL PROTECTED]> wrote: > > If I separate the form out from the dictionary however, the test > works, so it appears that it's the secondary lookup that this > assertion cannot handle. Does anyone know if that's correct, and/or if > there's a work-around or something I'm doing wrong?
You've pretty much identified the problem: assertFormError doesn't expand context dot notation in the same way that templates do. The name that is provided to the second argument of assertFormError is used directly as a key on the top level of the context dictionary.This also yields the immediate workaround - put the form in the top level of the context. There is some merit to the suggestion that the dot notation should be expanded in this case. Feel free to open a ticket to suggest this enhancement. If you're feeling particularly enthusiastic, the definition for assertFormError is in django/trunk/django/test/testcases.py; adding this functionality shouldn't be too difficult (remembering that the dot notation can represent a number of possible lookup alternatives). Yours, Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

