Updated BrowserID login to set display name (bug 748576)
This commit is contained in:
Родитель
34d6f50cde
Коммит
2f8b55a534
|
@ -613,6 +613,7 @@ class TestLogin(UserViewBase):
|
|||
profiles = UserProfile.objects.filter(email=email)
|
||||
eq_(len(profiles), 1)
|
||||
eq_(profiles[0].username, 'newuser')
|
||||
eq_(profiles[0].display_name, 'newuser')
|
||||
|
||||
@patch.object(waffle, 'switch_is_active', lambda x: True)
|
||||
@patch.object(settings, 'APP_PREVIEW', True)
|
||||
|
@ -749,6 +750,7 @@ class TestLogin(UserViewBase):
|
|||
eq_(res.status_code, 200)
|
||||
profiles = UserProfile.objects.filter(email=email)
|
||||
eq_(profiles[0].username, 'jbalogh2')
|
||||
eq_(profiles[0].display_name, 'jbalogh2')
|
||||
# Note: lower level unit tests for this functionality are in
|
||||
# TestAutoCreateUsername()
|
||||
|
||||
|
|
|
@ -338,7 +338,8 @@ def browserid_authenticate(request, assertion):
|
|||
'<a href="https://developer.mozilla.org/en-US/apps">'
|
||||
'Learn more</a>')
|
||||
return (None, _m)
|
||||
profile = UserProfile.objects.create(username=username, email=email)
|
||||
profile = UserProfile.objects.create(username=username, email=email,
|
||||
display_name=username)
|
||||
profile.create_django_user()
|
||||
profile.user.backend = 'django_browserid.auth.BrowserIDBackend'
|
||||
if settings.APP_PREVIEW:
|
||||
|
|
Загрузка…
Ссылка в новой задаче