Changeset 12523 for main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Timestamp:
- 30 Jan 2015, 11:09:08 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/authentication.py
r11997 r12523 1 ## $Id : authentication.py 10055 2013-04-04 15:12:43Z uli$1 ## $Id$ 2 2 ## 3 3 ## Copyright (C) 2014 Uli Fouquet & Henrik Bettermann … … 22 22 import time 23 23 from zope.component import getUtility 24 from zope.catalog.interfaces import ICatalog 24 25 from zope.password.interfaces import IPasswordManager 25 26 from zope.pluggableauth.interfaces import ( … … 187 188 customer = customerscontainer.get(login, None) 188 189 if customer is None: 189 return None 190 cat = getUtility(ICatalog, name='customers_catalog') 191 results = list( 192 cat.searchResults(email=(login, login))) 193 if len(results) != 1: 194 return None 195 customer = results[0] 190 196 return IUserAccount(customer) 191 197 -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/interfaces.py
r12521 r12523 227 227 email = TextLineChoice( 228 228 title = _(u'Email'), 229 required = False,229 required = True, 230 230 constraint=validate_email, 231 231 source = contextual_email_source, -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12521 r12523 550 550 # Tests for Customer class views and pages 551 551 552 def test_customer_login_with_email(self): 553 self.assertEqual(self.customer.state, 'created') 554 self.browser.open(self.login_path) 555 self.browser.getControl(name="form.login").value = self.customer.email 556 self.browser.getControl(name="form.password").value = 'cpwd' 557 self.browser.getControl("Login").click() 558 self.assertEqual(self.browser.url, self.customer_path) 559 self.assertTrue('You logged in' in self.browser.contents) 560 # Status has changed 561 self.assertEqual(self.customer.state, 'started') 562 return 563 552 564 def test_customer_change_password(self): 553 565 # Customers can change the password
Note: See TracChangeset for help on using the changeset viewer.