request: Fix unnecessary translation tag for assertion.

This commit is contained in:
Tim Abbott 2017-03-09 00:16:15 -08:00
parent aacef438bc
commit ac20872f9d
2 changed files with 3 additions and 2 deletions

View File

@ -75,7 +75,8 @@ class REQ(object):
self.argument_type = argument_type
if converter and validator:
raise Exception(_('converter and validator are mutually exclusive'))
# Not user-facing, so shouldn't be tagged for translation
raise AssertionError('converter and validator are mutually exclusive')
# Extracts variables from the request object and passes them as
# named function arguments. The request object must be the first

View File

@ -139,7 +139,7 @@ class DecoratorTestCase(TestCase):
def test_REQ_converter_and_validator_invalid(self):
# type: () -> None
with self.assertRaisesRegex(Exception, "converter and validator are mutually exclusive"):
with self.assertRaisesRegex(AssertionError, "converter and validator are mutually exclusive"):
@has_request_variables
def get_total(request, numbers=REQ(validator=check_list(check_int),
converter=lambda: None)):