﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
9381	Errors in django.contib.auth PasswordResetTest	kit1980	nobody	"Current version of tests gets wrong path to password reset confirm page (regexp doesn't takes token and uid) from password reset confirmation email.
And actually we don't need full path from email, only uid + token part, because tests.views from django.contib.auth sets urls = 'django.contrib.auth.urls' and real project urls are not valid.

For example, if we send email ""Please confirm http://127.0.0.1:8000/accounts/password/reset/1-271-fc1325747eabe02fab7e/ Thanks!"", in current version with 
{{{
re.search(r""https?://[^/]*(/.*reset/\S*)"", email.body) 
}}}
we get confirmation path as /accounts/password/reset/ , but it should be /reset/1-271-fc1325747eabe02fab7e/

Simple patch:

{{{
--- views.py    (revision 9232)
+++ views.py    (working copy)
@@ -34,9 +34,9 @@
         return self._read_signup_email(mail.outbox[0])

     def _read_signup_email(self, email):
-        urlmatch = re.search(r""https?://[^/]*(/.*reset/\S*)"", email.body)
+        urlmatch = re.search(r""https?://.*(/.+/)"", email.body)
         self.assert_(urlmatch is not None, ""No URL found in sent email"")
-        return urlmatch.group(), urlmatch.groups()[0]
+        return urlmatch.group(), ""/reset"" + urlmatch.groups()[0]

     def test_confirm_valid(self):
         url, path = self._test_confirm_start()


}}}

"		closed	contrib.auth	dev		invalid	PasswordResetTest, tests		Unreviewed	1	0	0	0	0	0
