mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-22 16:31:15 -05:00
allow updating auth type
This commit is contained in:
@@ -107,6 +107,7 @@ class UserSchema(BaseSchema):
|
|||||||
|
|
||||||
|
|
||||||
class UserUpdateAttributeSchema(BaseSchema):
|
class UserUpdateAttributeSchema(BaseSchema):
|
||||||
|
auth_type = field_for(models.User, 'auth_type')
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = models.User
|
model = models.User
|
||||||
|
|||||||
@@ -546,3 +546,15 @@ def test_update_user_resets_failed_login_count_if_updating_password(client, samp
|
|||||||
|
|
||||||
assert resp.status_code == 200
|
assert resp.status_code == 200
|
||||||
assert user.failed_login_count == 0
|
assert user.failed_login_count == 0
|
||||||
|
|
||||||
|
|
||||||
|
def test_update_user_auth_type(admin_request, sample_user):
|
||||||
|
assert sample_user.auth_type == 'sms_auth'
|
||||||
|
resp = admin_request.post(
|
||||||
|
'user.update_user_attribute',
|
||||||
|
user_id=sample_user.id,
|
||||||
|
_data={'auth_type': 'email_auth'},
|
||||||
|
)
|
||||||
|
|
||||||
|
assert resp['data']['id'] == str(sample_user.id)
|
||||||
|
assert resp['data']['auth_type'] == 'email_auth'
|
||||||
|
|||||||
Reference in New Issue
Block a user