Add the ability to specify additional fields on the user model that can be used for logging in.

This commit is contained in:
Matt Wright
2013-10-16 14:00:36 -04:00
parent 80f5fa8dbb
commit 1ae6bc3cf1
9 changed files with 63 additions and 27 deletions
+11
View File
@@ -826,3 +826,14 @@ class ConfirmableExtendFormsTest(SecurityTest):
def test_send_confirmation(self):
r = self._get('/confirm', follow_redirects=True)
self.assertIn("My Send Confirmation Email Address Field", r.data)
class AdditionalUserIdentityAttributes(SecurityTest):
AUTH_CONFIG = {
'SECURITY_USER_IDENTITY_ATTRIBUTES': ('email', 'username')
}
def test_authenticate(self):
r = self.authenticate(email='matt')
self.assertIn('Hello matt@lp.com', r.data)