Changeset 12841


Ignore:
Timestamp:
1 Apr 2015, 08:39:42 (10 years ago)
Author:
Henrik Bettermann
Message:

Move test.

File:
1 edited

Legend:

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

    r12840 r12841  
    383383        return
    384384
    385 class SupplementaryBrowserTests(UniversitySetup):
    386     # These are additional tests to browser.txt
    387 
    388     def test_set_former_course(self):
    389         # A certificate course will be automatically removed when the
    390         # former_course attribute of the corresponding course is set.
    391         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    392         self.assertTrue('COURSE1_100' in self.app[
    393             'faculties']['fac1']['dep1'].certificates['CERT1'])
    394         self.browser.open(
    395             'http://localhost/app/faculties/fac1/dep1/courses/COURSE1/manage')
    396         self.browser.getControl(name="form.former_course").value = ['selected']
    397         self.browser.getControl("Save").click()
    398         self.assertFalse('COURSE1_100' in self.app[
    399             'faculties']['fac1']['dep1'].certificates['CERT1'])
    400         return
    401 
    402     def test_remove_course(self):
    403         # We add a second certificate course which refers
    404         # to the same course but at a different level.
    405         self.app['faculties']['fac1']['dep1'].certificates[
    406             'CERT1'].addCertCourse(
    407             self.course, level=210)
    408         # Both certificate courses will be automatically removed when
    409         # the corresponding course is removed.
    410         self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    411         self.assertTrue('COURSE1_100' in self.app[
    412             'faculties']['fac1']['dep1'].certificates['CERT1'])
    413         self.assertTrue('COURSE1_210' in self.app[
    414             'faculties']['fac1']['dep1'].certificates['CERT1'])
    415         self.browser.open('http://localhost/app/faculties/fac1/dep1/manage')
    416         ctrl = self.browser.getControl(name='val_id')
    417         ctrl.getControl(value='COURSE1').selected = True
    418         self.browser.getControl("Remove selected", index=0).click()
    419         self.assertFalse('COURSE1_100' in self.app[
    420             'faculties']['fac1']['dep1'].certificates['CERT1'])
    421         self.assertFalse('COURSE1_210' in self.app[
    422             'faculties']['fac1']['dep1'].certificates['CERT1'])
    423         return
    424 
    425385    def test_user_data_import_permission(self):
    426386        upload_path = 'http://localhost/app/datacenter/upload'
     
    445405        self.assertTrue('User Processor' in self.browser.contents)
    446406        return
     407
     408class SupplementaryBrowserTests(UniversitySetup):
     409    # These are additional tests to browser.txt
     410
     411    def test_set_former_course(self):
     412        # A certificate course will be automatically removed when the
     413        # former_course attribute of the corresponding course is set.
     414        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     415        self.assertTrue('COURSE1_100' in self.app[
     416            'faculties']['fac1']['dep1'].certificates['CERT1'])
     417        self.browser.open(
     418            'http://localhost/app/faculties/fac1/dep1/courses/COURSE1/manage')
     419        self.browser.getControl(name="form.former_course").value = ['selected']
     420        self.browser.getControl("Save").click()
     421        self.assertFalse('COURSE1_100' in self.app[
     422            'faculties']['fac1']['dep1'].certificates['CERT1'])
     423        return
     424
     425    def test_remove_course(self):
     426        # We add a second certificate course which refers
     427        # to the same course but at a different level.
     428        self.app['faculties']['fac1']['dep1'].certificates[
     429            'CERT1'].addCertCourse(
     430            self.course, level=210)
     431        # Both certificate courses will be automatically removed when
     432        # the corresponding course is removed.
     433        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     434        self.assertTrue('COURSE1_100' in self.app[
     435            'faculties']['fac1']['dep1'].certificates['CERT1'])
     436        self.assertTrue('COURSE1_210' in self.app[
     437            'faculties']['fac1']['dep1'].certificates['CERT1'])
     438        self.browser.open('http://localhost/app/faculties/fac1/dep1/manage')
     439        ctrl = self.browser.getControl(name='val_id')
     440        ctrl.getControl(value='COURSE1').selected = True
     441        self.browser.getControl("Remove selected", index=0).click()
     442        self.assertFalse('COURSE1_100' in self.app[
     443            'faculties']['fac1']['dep1'].certificates['CERT1'])
     444        self.assertFalse('COURSE1_210' in self.app[
     445            'faculties']['fac1']['dep1'].certificates['CERT1'])
     446        return
Note: See TracChangeset for help on using the changeset viewer.