mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-15 07:18:58 -04:00
Use boolean logic instead of any/all
Using and/or over any/all has a couple of advantages: - it's a bit quicker - it won't evaluate the second half at all if the first half fails – if it is in business hours, and convert_to_boolean would raise, with your use of all we'd throw a 500, whereas if we had or, business_hours would trip and we'd skip over the second half without worrying about exceptions any and all are designed for use with variable length args eg `any(x for x in thing())`
This commit is contained in:
@@ -157,7 +157,7 @@ def test_passes_user_details_through_flow(
|
||||
])
|
||||
@pytest.mark.parametrize('ticket_type, expected_response, expected_redirect, expected_error', [
|
||||
('problem', 200, no_redirect(), element.Tag),
|
||||
('question', 302, partial(url_for, 'main.thanks', urgent=True, anonymous=True), type(None)),
|
||||
('question', 302, partial(url_for, 'main.thanks', anonymous=True, urgent=True), type(None)),
|
||||
])
|
||||
def test_email_address_required_for_problems(
|
||||
client,
|
||||
|
||||
Reference in New Issue
Block a user