yes, otherwise the mock side_effect blows up the test client.


On Mon, Mar 17, 2014 at 1:50 PM, Greg Price <notifications@github.com>wrote:

> In common/djangoapps/student/tests/test_create_account.py:
>
> > +        }
> > +
> > +    def test_cs_user_created(self, request):
> > +        "If user account creation succeeds, we should create a comments service user"
> > +        response = self.client.post(self.url, self.params)
> > +        self.assertEqual(response.status_code, 200)
> > +        self.assertTrue(request.called)
> > +        args, kwargs = request.call_args
> > +        self.assertEqual(args[0], 'put')
> > +        self.assertTrue(args[1].startswith(TEST_CS_URL))
> > +        self.assertEqual(kwargs['data']['username'], self.params['username'])
> > +
> > +    @mock.patch("student.models.Registration.register", side_effect=Exception)
> > +    def test_cs_user_not_created(self, register, request):
> > +        "If user account creation fails, we should not create a comments service user"
> > +        try:
>
> Is the try block necessary?
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/edx/edx-platform/pull/2957/files#r10668963>
> .
>