def test_NameAlreadyTaken_bad_request(self):
     error_view = create_webservice_error_view(NameAlreadyTaken())
     self.assertEqual(CONFLICT, error_view.status)
 def test_DeleteSubscriptionError_bad_request(self):
     error_view = create_webservice_error_view(DeleteSubscriptionError())
     self.assertEqual(BAD_REQUEST, error_view.status)
 def test_CannotTransitionToCountryMirror_bad_request(self):
     error_view = create_webservice_error_view(
         CannotTransitionToCountryMirror())
     self.assertEqual(BAD_REQUEST, error_view.status)
 def test_PPACreationError_bad_request(self):
     error_view = create_webservice_error_view(PPACreationError())
     self.assertEqual(BAD_REQUEST, error_view.status)
 def test_TeamMembershipTransitionError_bad_request(self):
     error_view = create_webservice_error_view(
         TeamMembershipTransitionError())
     self.assertEqual(BAD_REQUEST, error_view.status)
 def test_QuestionTargetError(self):
     error_view = create_webservice_error_view(QuestionTargetError())
     self.assertEqual(400, error_view.status)
 def test_InclusiveTeamLinkageError_forbidden(self):
     error_view = create_webservice_error_view(InclusiveTeamLinkageError())
     self.assertEqual(FORBIDDEN, error_view.status)
Example #8
0
 def test_PersonLinkageError_forbidden(self):
     error_view = create_webservice_error_view(PrivatePersonLinkageError())
     self.assertEqual(FORBIDDEN, error_view.status)
Example #9
0
 def test_PPACreationError_bad_request(self):
     error_view = create_webservice_error_view(PPACreationError())
     self.assertEqual(BAD_REQUEST, error_view.status)
 def test_QuestionTargetError(self):
     error_view = create_webservice_error_view(QuestionTargetError())
     self.assertEqual(400, error_view.status)
Example #11
0
 def test_InclusiveTeamLinkageError_forbidden(self):
     error_view = create_webservice_error_view(InclusiveTeamLinkageError())
     self.assertEqual(FORBIDDEN, error_view.status)
 def test_NotQuestionOwnerError(self):
     error_view = create_webservice_error_view(NotQuestionOwnerError())
     self.assertEqual(400, error_view.status)
 def test_NotAnswerContactError(self):
     error_view = create_webservice_error_view(NotAnswerContactError())
     self.assertEqual(400, error_view.status)
 def test_InvalidQuestionStateError(self):
     error_view = create_webservice_error_view(InvalidQuestionStateError())
     self.assertEqual(400, error_view.status)
Example #15
0
 def test_ImmutableVisibilityError_forbidden(self):
     error_view = create_webservice_error_view(
         ImmutableVisibilityError())
     self.assertEqual(FORBIDDEN, error_view.status)
Example #16
0
 def test_JoinNotAllowed_bad_request(self):
     error_view = create_webservice_error_view(JoinNotAllowed())
     self.assertEqual(BAD_REQUEST, error_view.status)
 def test_NotAnswerContactError(self):
     error_view = create_webservice_error_view(NotAnswerContactError())
     self.assertEqual(400, error_view.status)
Example #18
0
 def test_TeamMembershipTransitionError_bad_request(self):
     error_view = create_webservice_error_view(
         TeamMembershipTransitionError())
     self.assertEqual(BAD_REQUEST, error_view.status)
Example #19
0
 def test_SubscriptionPrivacyViolation_bad_request(self):
     error_view = create_webservice_error_view(
         SubscriptionPrivacyViolation())
     self.assertEqual(BAD_REQUEST, error_view.status)
Example #20
0
 def test_DistroSeriesDifferenceError_bad_request(self):
     error_view = create_webservice_error_view(
         DistroSeriesDifferenceError())
     self.assertEqual(BAD_REQUEST, error_view.status)
Example #21
0
 def test_PersonLinkageError_forbidden(self):
     error_view = create_webservice_error_view(PrivatePersonLinkageError())
     self.assertEqual(FORBIDDEN, error_view.status)
Example #22
0
 def test_DeleteSubscriptionError_bad_request(self):
     error_view = create_webservice_error_view(DeleteSubscriptionError())
     self.assertEqual(BAD_REQUEST, error_view.status)
Example #23
0
 def test_JoinNotAllowed_bad_request(self):
     error_view = create_webservice_error_view(JoinNotAllowed())
     self.assertEqual(BAD_REQUEST, error_view.status)
Example #24
0
 def test_UserCannotSubscribePerson_authorised(self):
     error_view = create_webservice_error_view(UserCannotSubscribePerson())
     self.assertEqual(UNAUTHORIZED, error_view.status)
Example #25
0
 def test_DistroSeriesDifferenceError_bad_request(self):
     error_view = create_webservice_error_view(
         DistroSeriesDifferenceError())
     self.assertEqual(BAD_REQUEST, error_view.status)
Example #26
0
 def test_CannotTransitionToCountryMirror_bad_request(self):
     error_view = create_webservice_error_view(
         CannotTransitionToCountryMirror())
     self.assertEqual(BAD_REQUEST, error_view.status)
Example #27
0
 def test_UserCannotSubscribePerson_authorised(self):
     error_view = create_webservice_error_view(UserCannotSubscribePerson())
     self.assertEqual(UNAUTHORIZED, error_view.status)
Example #28
0
 def test_UserCannotChangeMembershipSilently_authorised(self):
     error_view = create_webservice_error_view(
         UserCannotChangeMembershipSilently())
     self.assertEqual(UNAUTHORIZED, error_view.status)
Example #29
0
 def test_UserCannotChangeMembershipSilently_authorised(self):
     error_view = create_webservice_error_view(
         UserCannotChangeMembershipSilently())
     self.assertEqual(UNAUTHORIZED, error_view.status)
Example #30
0
 def test_NameAlreadyTaken_bad_request(self):
     error_view = create_webservice_error_view(NameAlreadyTaken())
     self.assertEqual(CONFLICT, error_view.status)
Example #31
0
 def test_CommercialSubscribersOnly_forbidden(self):
     error_view = create_webservice_error_view(CommercialSubscribersOnly())
     self.assertEqual(FORBIDDEN, error_view.status)
Example #32
0
 def test_CommercialSubscribersOnly_forbidden(self):
     error_view = create_webservice_error_view(CommercialSubscribersOnly())
     self.assertEqual(FORBIDDEN, error_view.status)
 def test_InvalidQuestionStateError(self):
     error_view = create_webservice_error_view(InvalidQuestionStateError())
     self.assertEqual(400, error_view.status)
Example #34
0
 def test_ImmutableVisibilityError_forbidden(self):
     error_view = create_webservice_error_view(ImmutableVisibilityError())
     self.assertEqual(FORBIDDEN, error_view.status)
 def test_NotQuestionOwnerError(self):
     error_view = create_webservice_error_view(NotQuestionOwnerError())
     self.assertEqual(400, error_view.status)
Example #36
0
 def test_LibrarianServerError_timeout(self):
     error_view = create_webservice_error_view(LibrarianServerError())
     self.assertEqual(httplib.REQUEST_TIMEOUT, error_view.status)
Example #37
0
 def test_LibrarianServerError_timeout(self):
     error_view = create_webservice_error_view(LibrarianServerError())
     self.assertEqual(httplib.REQUEST_TIMEOUT, error_view.status)
Example #38
0
 def test_InvalidDuplicateValue_expectation_failed(self):
     error_view = create_webservice_error_view(
         InvalidDuplicateValue("Dup"))
     self.assertEqual(EXPECTATION_FAILED, error_view.status)