Skip to content

Commit

Permalink
Test new validation
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathansberry committed Jan 8, 2025
1 parent 2cbe542 commit 0e2e2f4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ckanext/dataset_subscriptions/tests/actions/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ def test_user_validate_plugin_extras_valid_phonenumber(self, client_mock, sysadm
helpers.call_action('user_create', context=sysadmin_context, **user_dict)

@pytest.mark.parametrize('phonenumber, enable_sms, enable_whatsapp, expectation', [
("", False, False, nullcontext(1)),
("+44712345678", False, False, nullcontext(1)),
("", False, True, pytest.raises(toolkit.ValidationError)),
("", True, False, pytest.raises(toolkit.ValidationError)),
("", True, True, pytest.raises(toolkit.ValidationError))
("", True, True, pytest.raises(toolkit.ValidationError)),
("+44712345678", True, True, pytest.raises(toolkit.ValidationError)),
])
def test_user_validate_plugin_extras_requires_phonenumber(self, phonenumber, enable_sms,
enable_whatsapp, expectation, sysadmin_context):
Expand Down

0 comments on commit 0e2e2f4

Please sign in to comment.