Ignore:
Timestamp:
18 Jul 2012, 06:47:21 (12 years ago)
Author:
Henrik Bettermann
Message:

ObjectHistory? method, helper function and view to modify (manipulate) student history messages.

File:
1 edited

Legend:

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

    r9011 r9012  
    3333from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase
    3434
     35from waeup.kofa.utils.browser import replaceStudentMessages
    3536from waeup.kofa.students.tests.test_browser import StudentsFullSetup
    3637
    3738class UtilsUITests(StudentsFullSetup):
    38     # Tests for Student class views and pages
    3939
    4040    layer = FunctionalLayer
     41
     42    def test_replace_student_messages(self):
     43        self.assertTrue('Student record created by system' in
     44            self.student.history.messages[0])
     45        replaceStudentMessages('system', 'me')
     46        self.assertTrue('Student record created by me' in
     47            self.student.history.messages[0])
     48
     49    def test_modify_all_student_history(self):
     50        self.assertTrue('Student record created by system' in
     51            self.student.history.messages[0])
     52        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     53        self.browser.open('http://localhost/app/modify_student_history')
     54        self.assertTrue(
     55            'Syntax: /modify_student_history?old=[old string]&new=[new string]'
     56            in self.browser.contents)
     57        self.browser.open(
     58            'http://localhost/app/modify_student_history?old=by system&new=by me')
     59        self.assertTrue('Finished' in self.browser.contents)
     60        self.assertTrue('Student record created by me' in
     61            self.student.history.messages[0])
    4162
    4263    def test_reindex(self):
Note: See TracChangeset for help on using the changeset viewer.