Ignore:
Timestamp:
1 Feb 2015, 06:06:11 (10 years ago)
Author:
Henrik Bettermann
Message:

Test registration request.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba/customers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py

    r12531 r12532  
    3636from waeup.ikoba.interfaces import MessageFactory as _
    3737from waeup.ikoba.interfaces import (
    38     IContactForm, IObjectHistory, IIkobaObject, IIkobaUtils,
     38    IContactForm, IObjectHistory, IIkobaObject, IIkobaUtils, IExtFileStore,
    3939    IPasswordValidator, IUserAccount,
    4040    STARTED, VERIFIED, REJECTED, EXPIRED, CREATED, REQUESTED,
     
    737737        """To be implemented in the customization package.
    738738        """
     739        store = getUtility(IExtFileStore)
     740        error = ''
     741        if not store.getFileByContext(self.context, attr=u'passport.jpg'):
     742            error += _('Passport picture is missing.')
     743        if error:
     744            return error
    739745        return
    740746
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py

    r12527 r12532  
    611611        return
    612612
    613     def test_customer_upload_passport(self):
     613    def test_customer_edit_upload_upload_and_request(self):
    614614        # Customer cant login if their password is not set
    615615        self.browser.open(self.login_path)
     
    619619        self.assertMatches(
    620620            '...You logged in...', self.browser.contents)
    621         # Admitted customer can upload a passport picture
     621        self.browser.getLink("Edit").click()
     622        self.browser.getControl(name="form.email").value = 'new_email@aa.ng'
     623        self.browser.getControl("Save", index=1).click()
     624        self.assertMatches('...Form has been saved...',
     625                           self.browser.contents)
     626        self.browser.getControl("Save and request registration").click()
     627        self.assertMatches('...Passport picture is missing...',
     628                           self.browser.contents)
     629        self.assertEqual(self.customer.state, 'started')
     630        # Customer must upload a passport picture
     631        self.browser.open(self.customer_path)
    622632        self.browser.getLink("Upload files").click()
    623633        ctrl = self.browser.getControl(name='passporteditupload')
     
    632642        self.browser.getControl(name="CANCEL").click()
    633643        self.assertEqual(self.browser.url, self.customer_path)
    634 
    635     def test_customer_baseedit(self):
    636         # Customers can change the password
    637         self.customer.personal_updated = datetime.utcnow()
    638         self.browser.open(self.login_path)
    639         self.browser.getControl(name="form.login").value = self.customer_id
    640         self.browser.getControl(name="form.password").value = 'cpwd'
    641         self.browser.getControl("Login").click()
    642         self.assertEqual(self.browser.url, self.customer_path)
    643         self.assertTrue('You logged in' in self.browser.contents)
    644644        self.browser.getLink("Edit").click()
    645         self.browser.getControl(name="form.email").value = 'new_email@aa.ng'
    646         self.browser.getControl("Save", index=1).click()
    647         self.assertMatches('...Form has been saved...',
     645        self.browser.getControl("Save and request registration").click()
     646        self.assertMatches('...Registration form has been submitted...',
    648647                           self.browser.contents)
     648        self.assertEqual(self.customer.state, 'requested')
    649649        # Customer can view history
    650650        self.browser.getLink("History").click()
Note: See TracChangeset for help on using the changeset viewer.