Ignore:
Timestamp:
30 Jan 2015, 07:48:39 (10 years ago)
Author:
Henrik Bettermann
Message:

Use TextLineChoice? field for cutomer emails and ensure that email addresses are unique.

File:
1 edited

Legend:

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

    r12517 r12521  
    127127        customer.reg_number = u'123'
    128128        customer.sex = u'm'
    129         customer.email = 'aa@aa.ng'
     129        customer.email = u'aa@aa.ng'
    130130        customer.phone = u'1234'
    131131        customer.date_of_birth = date(1981, 2, 4)
     
    210210        self.browser.getControl(name="form.reg_number").value = '123'
    211211        self.browser.getControl("Create customer record").click()
    212         self.assertTrue('Registration number exists already'
     212        self.assertTrue('Registration number does exist.'
    213213            in self.browser.contents)
    214214        self.browser.getControl(name="form.reg_number").value = '1234'
     
    220220        self.browser.getControl(name="form.reg_number").value = '123'
    221221        self.browser.getControl("Save").click()
    222         self.assertMatches('...Registration number exists...',
     222        self.assertMatches('...Registration number does exist...',
    223223                           self.browser.contents)
    224224
     
    358358        self.browser.getControl("Send message now").click()
    359359        self.assertTrue('An smtp server error occurred' in self.browser.contents)
    360         self.customer.email = 'xx@yy.zz'
     360        self.customer.email = u'xx@yy.zz'
    361361        self.browser.getControl("Send message now").click()
    362362        self.assertTrue('Your message has been sent' in self.browser.contents)
     
    420420        open('customers.csv', 'wb').write(
    421421"""firstname,lastname,reg_number,date_of_birth,email,phone,sex,password
    422 Aaren,Pieri,1,1990-01-02,aa@aa.ng,1234,m,mypwd1
    423 Claus,Finau,2,1990-01-03,aa@aa.ng,1234,m,mypwd1
    424 Brit,Berson,2,1990-01-04,aa@aa.ng,1234,m,mypwd1
     422Aaren,Pieri,1,1990-01-02,bb@aa.ng,1234,m,mypwd1
     423Claus,Finau,2,1990-01-03,cc@aa.ng,1234,m,mypwd1
     424Brit,Berson,2,1990-01-04,dd@aa.ng,1234,m,mypwd1
    425425""")
    426426        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     
    766766
    767767    def test_create_account(self):
    768         # Customer with wrong number can't be found.
    769768        self.browser.open('http://localhost/app/createaccount')
    770769        self.browser.getControl(name="form.firstname").value = 'Ruben'
    771770        self.browser.getControl(name="form.lastname").value = 'Gonzales'
     771        self.browser.getControl(name="form.email").value = 'aa@aa.ng'
     772        self.browser.getControl("Send login credentials").click()
     773        # Email address exists.
     774        self.assertTrue('Email address does exist.' in self.browser.contents)
    772775        self.browser.getControl(name="form.email").value = 'newcustomer@xx.zz'
    773776        self.browser.getControl("Send login credentials").click()
    774         self.assertTrue('Your request was successful.'
    775             in self.browser.contents)
    776         # ... and  customer can be found in the catalog via the email address
     777        self.assertTrue('Your request was successful.' in self.browser.contents)
     778        # Customer can be found in the catalog via the email address
    777779        cat = queryUtility(ICatalog, name='customers_catalog')
    778780        results = list(
Note: See TracChangeset for help on using the changeset viewer.