From 3aa3ee04d23ac5ab561cc04af94b4f723df27323 Mon Sep 17 00:00:00 2001 From: calexandr Date: Fri, 10 Jan 2020 15:17:13 +0200 Subject: [PATCH] [#2838] fix multiple tests to pass email_is_unique validator --- ckan/tests/logic/action/test_update.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/ckan/tests/logic/action/test_update.py b/ckan/tests/logic/action/test_update.py index 982eee266c7..c464e6449d4 100644 --- a/ckan/tests/logic/action/test_update.py +++ b/ckan/tests/logic/action/test_update.py @@ -144,7 +144,6 @@ def test_user_update_with_invalid_name(self, name): user = factories.User() user["name"] = name with pytest.raises(logic.ValidationError): - helpers.call_action("user_update", **user) def test_user_update_to_name_that_already_exists(self): @@ -166,7 +165,8 @@ def test_user_update_password(self): # we're not updating it, otherwise validation fails. helpers.call_action( "user_update", - id=user["name"], + id=user["id"], + name=user["name"], email=user["email"], password="new password", ) @@ -254,7 +254,8 @@ def test_user_update_activity_stream(self): # fails. helpers.call_action( "user_update", - id=user["name"], + id=user["id"], + name=user["name"], email=user["email"], password=factories.User.attributes()["password"], fullname="updated full name", @@ -301,17 +302,13 @@ def test_user_update_with_custom_schema(self): helpers.call_action( "user_update", context={"schema": schema}, - id=user["name"], + id=user["id"], + name=user["name"], email=user["email"], password=factories.User.attributes()["password"], fullname="updated full name", ) - # Since we passed user['name'] to user_update as the 'id' param, - # our mock validator method should have been called once with - # user['name'] as arg. - mock_validator.assert_called_once_with(user["name"]) - def test_user_update_multiple(self): """Test that updating multiple user attributes at once works."""