Fix tests, add test for bug 727546

This commit is contained in:
Allen Short 2012-02-23 18:29:02 -06:00
Родитель 113da478d6
Коммит 4baefa63f6
2 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -443,7 +443,8 @@ class TestUserRegisterForm(UserFormBase):
'provider to complete your registration.')
def test_invalid_homepage(self):
data = {'homepage': 'example.com:alert(String.fromCharCode(88,83,83)'}
data = {'homepage': 'example.com:alert(String.fromCharCode(88,83,83)',
'email': ''}
m = 'This URL has an invalid format. '
m += 'Valid URLs look like http://example.com/my_page.'
r = self.client.post('/en-US/firefox/users/register', data)
@ -455,6 +456,14 @@ class TestUserRegisterForm(UserFormBase):
self.assertContains(r, "You are already logged in")
self.assertNotContains(r, '<button type="submit">Register</button>')
def test_browserid_registered(self):
u = UserProfile.objects.get(email='jbalogh@mozilla.com')
u.password = ''
u.save()
data = {'email': 'jbalogh@mozilla.com'}
r = self.client.post('/en-US/firefox/users/register', data)
self.assertContains(r, 'already have an account')
def good_data(self):
return {
'email': 'john.connor@sky.net',

Просмотреть файл

@ -638,7 +638,7 @@ def register(request):
elif mkt_user.exists():
f = PasswordResetForm()
f.users_cache = [mkt_user[0].user]
f.users_cache = [mkt_user[0]]
f.save(use_https=request.is_secure(),
email_template_name='users/email/pwreset.ltxt',
request=request)