Changeset 8688 for main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Timestamp:
- 12 Jun 2012, 09:58:03 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r8685 r8688 21 21 import shutil 22 22 import tempfile 23 import pytz 24 from datetime import datetime, timedelta 23 25 from StringIO import StringIO 24 from datetime import datetime25 26 import os 26 27 import grok … … 171 172 self.course, level=100) 172 173 173 # Configure university 174 # Configure university and hostels 174 175 self.app['hostels'].accommodation_states = ['admitted'] 175 176 self.app['hostels'].accommodation_session = 2004 177 delta = timedelta(days=10) 178 self.app['hostels'].startdate = datetime.now(pytz.utc) - delta 179 self.app['hostels'].enddate = datetime.now(pytz.utc) + delta 176 180 self.app['configuration'].carry_over = True 177 181 configuration = createObject('waeup.SessionConfiguration') … … 1749 1753 sfeseries, sfenumber = parts 1750 1754 1751 # Students can use HOS code and book a bed space with it 1755 # Students can use HOS code and book a bed space with it ... 1752 1756 self.browser.open(self.acco_path) 1757 # ... but not if booking period has expired ... 1758 self.app['hostels'].enddate = datetime.now(pytz.utc) 1759 self.browser.getLink("Book accommodation").click() 1760 self.assertMatches('...Outside booking period: ...', 1761 self.browser.contents) 1762 self.app['hostels'].enddate = datetime.now(pytz.utc) + timedelta(days=10) 1763 # ... or student is not the an allowed state ... 1753 1764 self.browser.getLink("Book accommodation").click() 1754 1765 self.assertMatches('...You are in the wrong...', … … 1758 1769 self.assertMatches('...Activation Code:...', 1759 1770 self.browser.contents) 1771 # Student can't used faked ACs ... 1760 1772 self.browser.getControl(name="ac_series").value = u'nonsense' 1761 1773 self.browser.getControl(name="ac_number").value = sfenumber … … 1763 1775 self.assertMatches('...Activation code is invalid...', 1764 1776 self.browser.contents) 1777 # ... or ACs owned by somebody else. 1765 1778 ac.owner = u'Anybody' 1766 1779 self.browser.getControl(name="ac_series").value = sfeseries
Note: See TracChangeset for help on using the changeset viewer.