Changeset 12816 for main/waeup.ikoba/trunk/src
- Timestamp:
- 23 Mar 2015, 16:47:58 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/browser/pages.py
r12540 r12816 280 280 # _('Your personal data record is outdated. Please update.'), 281 281 # type='warning') 282 self.redirect(self.application_url() + rel_link) 282 if camefrom == 'PasswordMandate': 283 self.redirect( 284 self.application_url() + 285 rel_link + 286 '/changepassword') 287 else: 288 self.redirect(self.application_url() + rel_link) 283 289 return 284 290 if not self.camefrom: -
main/waeup.ikoba/trunk/src/waeup/ikoba/mandates/browser.py
r11954 r12816 19 19 """ 20 20 import grok 21 from urllib import urlencode 21 22 from waeup.ikoba.browser.layout import UtilityView 22 23 from waeup.ikoba.interfaces import ICompany … … 42 43 return 43 44 msg = mandate.execute() 45 self.mandate_name = mandate.__class__.__name__ 44 46 self.flash(msg) 45 47 return 46 48 47 49 def render(self): 48 self.redirect(self.url(self.context, 'login')) 50 args = {'camefrom': self.mandate_name} 51 self.redirect(self.url(self.context) + '/login?%s' % urlencode(args)) 49 52 return -
main/waeup.ikoba/trunk/src/waeup/ikoba/mandates/tests.py
r11984 r12816 153 153 % mandate.mandate_id) 154 154 # Password has been set. 155 self.assertTrue('Password has been successfully set. Login with your new password.' 155 self.assertTrue( 156 'Password has been successfully set. Login with your new password.' 156 157 in self.browser.contents) 157 158 self.assertTrue(IUserAccount(customer).checkPassword('mypwd1')) … … 159 160 self.assertEqual(len(self.app['mandates'].keys()), 0) 160 161 # We redirect to login page not to the frontpage. 161 self.assertEqual(self.browser.url, 'http://localhost/app/login') 162 self.assertEqual( 163 self.browser.url, 164 'http://localhost/app/login?camefrom=PasswordMandate') 165 # After login we redirect to the changepassword page. 166 self.browser.getControl(name="form.login").value = customer.customer_id 167 self.browser.getControl(name="form.password").value = 'mypwd1' 168 self.browser.getControl("Login").click() 169 self.assertEqual( 170 self.browser.url, 171 'http://localhost/app/customers/%s/changepassword' 172 % customer.customer_id)
Note: See TracChangeset for help on using the changeset viewer.