Skip to content

Commit

Permalink
[#1117] Add a new test for updating multiple user attributes at once
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Hammond committed Aug 1, 2013
1 parent 8bcccd2 commit e947f4a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions ckan/new_tests/logic/action/test_update.py
Expand Up @@ -236,6 +236,31 @@ def test_user_update_with_custom_schema(self):
# 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.'''

user = factories.User()

params = {
'id': user['id'],
'name': 'updated_name',
'fullname': 'updated full name',
'about': 'updated about',
# FIXME: We shouldn't have to put email here since we're not
# updating it, but user_update sucks.
'email': user['email'],
# FIXME: We shouldn't have to put password here since we're not
# updating it, but user_update sucks.
'password': factories.User.attributes()['password'],
}

helpers.call_action('user_update', **params)

updated_user = helpers.call_action('user_show', id=user['id'])
assert updated_user['name'] == 'updated_name'
assert updated_user['fullname'] == 'updated full name'
assert updated_user['about'] == 'updated about'

def test_user_update_with_deferred_commit(self):
'''Test that user_update()'s deferred_commit option works.
Expand Down

0 comments on commit e947f4a

Please sign in to comment.