Re: TestCase, Client() and Exception

2007-07-10 Thread James Bennett
On 7/10/07, Mambaragi <[EMAIL PROTECTED]> wrote: > As you see, I view function raises an exception, the exception is > always regarded as "TemplateDoesNotExist". > So I have to change the test case to... > > ] client = Client() > ] self.assertRaises(TemplateDoesNotExist, client.get, "/user/ >

Re: TestCase, Client() and Exception

2007-07-10 Thread Russell Keith-Magee
On 7/10/07, Mambaragi <[EMAIL PROTECTED]> wrote: > > ] client = Client() > ] self.assertRaises(TemplateDoesNotExist, client.get, "/user/ > preferences/") > > Is is a bug or my mistake?? It's a mistake on your part. assertRaises isn't a very effective test for the test Client, because web

TestCase, Client() and Exception

2007-07-10 Thread Mambaragi
Hello, I use django 0.96 and Python 2.5 the following is one of the view functions. I set this function always raises an LoginRequiredException. ] def preferences(req): ] raise LoginRequiredException, "please, log in" and the test case. ] client = Client() ]