mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
Finally finished linting all the tests!
...Now to fix the ones I broke... :lolsob: Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
This commit is contained in:
@@ -5,11 +5,11 @@ from app.main.forms import CreateKeyForm
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"expiry_date, expected_errors",
|
||||
(
|
||||
("expiry_date", "expected_errors"),
|
||||
[
|
||||
(None, ["A key with this name already exists"]),
|
||||
("2001-01-01 01:01:01", None),
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_return_validation_error_when_key_name_exists(
|
||||
client_request,
|
||||
@@ -35,7 +35,7 @@ def test_return_validation_error_when_key_name_exists(
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"key_type, expected_error",
|
||||
("key_type", "expected_error"),
|
||||
[("", "Select the type of key"), ("invalid", "Select the type of key")],
|
||||
)
|
||||
def test_return_validation_error_when_key_type_not_chosen(
|
||||
|
||||
@@ -24,7 +24,13 @@ def test_form_class_not_mutated(notify_admin):
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"service_can_send_international_sms, placeholder_name, template_type, value, expected_error",
|
||||
(
|
||||
"service_can_send_international_sms",
|
||||
"placeholder_name",
|
||||
"template_type",
|
||||
"value",
|
||||
"expected_error",
|
||||
),
|
||||
[
|
||||
(False, "email address", "email", "", "Cannot be empty"),
|
||||
(False, "email address", "email", "12345", "Enter a valid email address"),
|
||||
|
||||
@@ -13,7 +13,7 @@ def test_form_fails_validation_with_no_radio_buttons_selected(notify_admin):
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"selected_radio_button, selected_text_box, text_box_data",
|
||||
("selected_radio_button", "selected_text_box", "text_box_data"),
|
||||
[
|
||||
("email_address", "url", "http://www.example.com"),
|
||||
("phone_number", "url", "http://www.example.com"),
|
||||
@@ -40,7 +40,7 @@ def test_form_fails_validation_when_radio_button_selected_and_text_box_filled_in
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"selected_field, url, email_address, phone_number",
|
||||
("selected_field", "url", "email_address", "phone_number"),
|
||||
[
|
||||
("url", "http://www.example.com", "invalid-email.com", "phone"),
|
||||
("email_address", "www.invalid-url.com", "me@example.com", "phone"),
|
||||
|
||||
@@ -4,7 +4,7 @@ from app.main.forms import ServiceSmsSenderForm
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"sms_sender,error_expected,error_message",
|
||||
("sms_sender", "error_expected", "error_message"),
|
||||
[
|
||||
("", True, "Cannot be empty"),
|
||||
("22", True, "Enter 3 characters or more"),
|
||||
|
||||
@@ -30,8 +30,8 @@ def test_form_is_valid_returns_no_errors(
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"post_data, expected_error",
|
||||
(
|
||||
("post_data", "expected_error"),
|
||||
[
|
||||
(
|
||||
{"sms_code": "1234"},
|
||||
"Not enough numbers",
|
||||
@@ -52,7 +52,7 @@ def test_form_is_valid_returns_no_errors(
|
||||
{"sms_code": " ! 2 3 4 5 6"},
|
||||
"Numbers only",
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_check_verify_code_returns_errors(
|
||||
notify_admin,
|
||||
|
||||
Reference in New Issue
Block a user