Best way to tell if we're in a test

2011-04-29 Thread Jody McIntyre
What's the best way to tell (from regular code) if we're in a test? I have added extra authentication steps (security questions) that would be difficult to deal with in tests where you just want to run self.client.login() or post to the login URL. I've noticed that several third party modules

Re: Best way to tell if we're in a test

2011-04-29 Thread Jody McIntyre
return that the user answered the security question correctly or > something). > > Python's dynamic nature makes it easy to monkey patch things like this. > Look at the Mock class: http://python-mock.sourceforge.net/ > > > On Fri, Apr 29, 2011 at 12:53 PM, Jody McIntyre wrot

Re: what is the recommended way to display currency?

2011-06-06 Thread Jody McIntyre
Check out BabelDjango: http://babel.edgewall.org/wiki/BabelDjango We've been using it to display currencies and it works pretty well for our needs (which includes two currency formats, Canadian English ($1,123.45) and Canadian French (1 123,45$).) Cheers, Jody On Sun, Jun 5, 2011 at 4:39 PM, snf