Ignore:
Timestamp:
24 Feb 2013, 18:36:29 (12 years ago)
Author:
Henrik Bettermann
Message:

Add and adjust tests.

Location:
main/waeup.fceokene/trunk/src/waeup/fceokene
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.fceokene/trunk/src/waeup/fceokene/interswitch/tests.py

    r9956 r9998  
    105105            in self.browser.contents)
    106106
    107         # Let's do the same for maintenance fee payment
     107        # Maintenance fee payment
    108108
    109109        self.browser.open(self.payments_path)
     
    122122        # Bed is randomly selected but, since there is only
    123123        # one bed for this student, we know that ...
    124         self.assertMatches('...Hall 1, Block A, Room 101, Bed A...',
    125                            self.browser.contents)
    126         self.assertMatches('...ticket created...',
    127                            self.browser.contents)
     124        self.assertFalse('Hall 1, Block A, Room 101, Bed A'
     125                           in self.browser.contents)
     126        self.assertTrue('(see payment slip)'
     127                           in self.browser.contents)
     128        self.assertTrue('ticket created'
     129                           in self.browser.contents)
    128130        self.browser.open(self.payments_path + '/addop')
    129131        self.browser.getControl(
     
    139141        self.assertTrue(
    140142            '<span>4150.0</span>' in self.browser.contents)
     143        # p_item is not unveiled
     144        self.assertFalse('Hall 1, Block A, Room 101, Bed A'
     145            in self.browser.contents)
     146        self.assertTrue('(visible after successful payment)'
     147            in self.browser.contents)
    141148        self.payment_url = self.browser.url
    142149        self.assertEqual(self.student['payments'][value].provider_amt, 0.0)
     
    161168        # BT does nor charge a fee for maintenance fee
    162169        self.assertFalse("BT Education" in self.browser.contents)
    163 
    164         # Let's do the same for acceptance fee
     170        # p_item is not unveiled
     171        self.assertFalse('Hall 1, Block A, Room 101, Bed A'
     172            in self.browser.contents)
     173        self.assertTrue('(visible after successful payment)'
     174            in self.browser.contents)
     175        # If the ticket is paid coordinates are shown
     176        self.student['payments'][value].p_state = 'paid'
     177        self.browser.open(self.payment_url)
     178        self.assertTrue('Hall 1, Block A, Room 101, Bed A'
     179            in self.browser.contents)
     180        self.assertFalse('(visible after successful payment)'
     181            in self.browser.contents)
     182
     183        # Acceptance fee payment
    165184
    166185        self.browser.open(self.payments_path)
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/tests/test_browser.py

    r9953 r9998  
    342342        # Bed is randomly selected but, since there is only
    343343        # one bed for this student, we know that
    344         self.assertMatches('...Hall 1, Block A, Room 101, Bed A...',
    345                            self.browser.contents)
    346         return
     344        self.assertEqual(self.student['accommodation']['2004'].bed_coordinates,
     345            'Hall 1, Block A, Room 101, Bed A (regular_male_fr)')
     346        self.assertEqual(self.student['accommodation']['2004'].display_coordinates,
     347            '(see payment slip)')
     348        # But the bed coordinates are hidden.
     349        self.assertFalse('Hall 1, Block A, Room 101, Bed A'
     350            in self.browser.contents)
     351        self.assertTrue('<td>(see payment slip)</td>'
     352            in self.browser.contents)
     353        return
Note: See TracChangeset for help on using the changeset viewer.