def setUp(self): self.a = middleware.AjaxExceptionMiddleware() self.request1 = django.http.HttpRequest() self.request0 = django.http.HttpRequest() self.exception1 = comment_client.CommentClientError('{}') self.exception2 = comment_client.CommentClientError('Foo!') self.exception0 = ValueError() self.request1.META['HTTP_X_REQUESTED_WITH'] = "XMLHttpRequest" self.request0.META['HTTP_X_REQUESTED_WITH'] = "SHADOWFAX"
def setUp(self): super(AjaxExceptionTestCase, self).setUp() self.a = middleware.AjaxExceptionMiddleware() self.request1 = django.http.HttpRequest() self.request0 = django.http.HttpRequest() self.exception1 = lms.lib.comment_client.CommentClientRequestError('{}', 401) self.exception2 = lms.lib.comment_client.CommentClientRequestError('Foo!', 404) self.exception0 = lms.lib.comment_client.CommentClient500Error("Holy crap the server broke!") self.request1.META['HTTP_X_REQUESTED_WITH'] = "XMLHttpRequest" self.request0.META['HTTP_X_REQUESTED_WITH'] = "SHADOWFAX"