Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix tests, add test for bug 727546

  • Loading branch information...
commit 4baefa63f63946fcdd408bc6f241b376ae2e2e23 1 parent 113da47
@washort washort authored
Showing with 11 additions and 2 deletions.
  1. +10 −1 apps/users/tests/test_forms.py
  2. +1 −1  apps/users/views.py
View
11 apps/users/tests/test_forms.py
@@ -443,7 +443,8 @@ def test_invalid_email_domain(self):
'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 @@ def test_already_logged_in(self):
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',
View
2  apps/users/views.py
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.