Ignore:
Timestamp:
15 Aug 2015, 07:44:00 (9 years ago)
Author:
Henrik Bettermann
Message:

Add switch to disable all exports.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/tests/test_browser.py

    r13103 r13198  
    216216        return
    217217
     218    def test_export_disabled(self):
     219        self.app['configuration'].export_disabled_message = u'Export forbidden'
     220        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     221        self.browser.open(self.datacenter_path)
     222        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     223        self.assertEqual(self.browser.url, self.datacenter_path)
     224        self.browser.getLink("Export data").click()
     225        self.browser.getControl(name="exporter").value = ['faculties']
     226        self.browser.getControl("Create CSV file").click()
     227        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     228        self.assertTrue('div class="alert alert-danger">Export forbidden</div>'
     229                         in self.browser.contents)
     230        self.browser.getLink("selecting certain export paramers").click()
     231        self.browser.getControl(name="exporter").value = ['students']
     232        self.browser.getControl(name="session").value = ['all']
     233        self.browser.getControl(name="level").value = ['all']
     234        self.browser.getControl(name="mode").value = ['all']
     235        self.browser.getControl("Create CSV file").click()
     236        self.assertTrue('div class="alert alert-danger">Export forbidden</div>'
     237                         in self.browser.contents)
     238        return
     239
    218240    def test_export_download(self):
    219241        # we can download a generated export result
Note: See TracChangeset for help on using the changeset viewer.