put amo.email into django.user.username
This commit is contained in:
Родитель
6dcf2036c9
Коммит
9b05138a49
|
@ -28,7 +28,7 @@ class CakeTestCase(TestCase):
|
||||||
|
|
||||||
self.assertEqual(profile.firstname, user.first_name)
|
self.assertEqual(profile.firstname, user.first_name)
|
||||||
self.assertEqual(profile.lastname, user.last_name)
|
self.assertEqual(profile.lastname, user.last_name)
|
||||||
self.assertEqual(profile.nickname, user.username)
|
self.assertEqual(profile.email, user.username)
|
||||||
self.assertEqual(profile.email, user.email)
|
self.assertEqual(profile.email, user.email)
|
||||||
self.assertEqual(profile.created, user.date_joined)
|
self.assertEqual(profile.created, user.date_joined)
|
||||||
self.assertEqual(profile.password, user.password)
|
self.assertEqual(profile.password, user.password)
|
||||||
|
|
|
@ -110,7 +110,7 @@ class UserProfile(amo.ModelBase):
|
||||||
self.user = User(id=self.pk)
|
self.user = User(id=self.pk)
|
||||||
self.user.first_name = self.firstname
|
self.user.first_name = self.firstname
|
||||||
self.user.last_name = self.lastname
|
self.user.last_name = self.lastname
|
||||||
self.user.username = self.nickname
|
self.user.username = self.email
|
||||||
self.user.email = self.email
|
self.user.email = self.email
|
||||||
self.user.password = self.password
|
self.user.password = self.password
|
||||||
self.user.date_joined = self.created
|
self.user.date_joined = self.created
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
from datetime import datetime
|
||||||
import hashlib
|
import hashlib
|
||||||
|
|
||||||
from django import test
|
from django import test
|
||||||
|
@ -23,6 +24,14 @@ def test_welcome_name():
|
||||||
eq_(u4.welcome_name, '')
|
eq_(u4.welcome_name, '')
|
||||||
|
|
||||||
|
|
||||||
|
def test_empty_nickname():
|
||||||
|
u = UserProfile(email='yoyoyo@yo.yo', pk=1, created=datetime.now())
|
||||||
|
assert u.user is None
|
||||||
|
u.create_django_user()
|
||||||
|
assert u.user is not None
|
||||||
|
eq_(u.user.username, 'yoyoyo@yo.yo')
|
||||||
|
|
||||||
|
|
||||||
def test_resetcode_expires():
|
def test_resetcode_expires():
|
||||||
"""
|
"""
|
||||||
For some reasone resetcode is required, and we default it to
|
For some reasone resetcode is required, and we default it to
|
||||||
|
@ -32,7 +41,7 @@ def test_resetcode_expires():
|
||||||
"""
|
"""
|
||||||
|
|
||||||
u = UserProfile(lastname='Connor', pk=2, resetcode_expires=None,
|
u = UserProfile(lastname='Connor', pk=2, resetcode_expires=None,
|
||||||
email='j.connor@sky.net')
|
nickname='fffuuu', email='j.connor@sky.net')
|
||||||
u.save()
|
u.save()
|
||||||
assert u.resetcode_expires
|
assert u.resetcode_expires
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче