On Feb 17, 12:03 pm, Cody Django <codydja...@gmail.com> wrote: > For example, I have a captcha that is used in parts of a site that > affects form logic. > The django settings has a variable CAPTCHA = True, which acts as a > switch. > > I'd like to change this setting in the setup for each TestCase.
You should use a mock object, to fake a-priori things like stochastic user input. Python's mock library has a 'patch.object' feature which mocks a method on a class, even before objects of that class are instantiated. In most of your setUp calls, patch the captcha handler to trivially pass it, without real user input. To test the captcha, mock it to pass or fail. -- Phlip http://c2.com/cgi/wiki?ZeekLand -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.