Skip to content

Commit

Permalink
[#1117] Add a test for user_update's annoying email behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Hammond committed Aug 1, 2013
1 parent 650807e commit bdc0884
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ckan/new_tests/logic/action/test_update.py
Expand Up @@ -171,6 +171,26 @@ def test_user_update_with_invalid_password(self):
helpers.call_action, 'user_update',
**user)

def test_user_update_without_email_address(self):
'''You have to pass an email address when you call user_update.
Even if you don't want to change the user's email address, you still
have to pass their current email address to user_update.
FIXME: The point of this feature seems to be to prevent people from
removing email addresses from user accounts, but making them post the
current email address every time they post to user update is just
annoying, they should be able to post a dict with no 'email' key to
user_update and it should simply not change the current email.
'''
user = factories.User()
del user['email']

nose.tools.assert_raises(logic.ValidationError,
helpers.call_action, 'user_update',
**user)

# TODO: Valid and invalid values for the rest of the user model's fields.

def test_user_update_activity_stream(self):
Expand Down

0 comments on commit bdc0884

Please sign in to comment.