Ignore:
Timestamp:
17 Dec 2011, 12:54:39 (13 years ago)
Author:
Henrik Bettermann
Message:

Define two different (convenience?) methods: fullname and display_fullname. The first one is a hyphen-separated string of all name parts and is meant for indexing only. The second one uses the SIRPUtils fullname method and is meant for displaying the fullname in the UI. It can be easily customized according to the requirements of the school.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/students/tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_authentication.py

    r7233 r7364  
    6161class FakeStudent(object):
    6262    student_id = 'test_stud'
    63     fullname = 'Test User'
     63    display_fullname = 'Test User'
    6464    password = None
    6565    email = None
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py

    r7357 r7364  
    279279        self.assertTrue('Anna Tester' in self.browser.contents)
    280280
    281         # We can find a student with a certain fullname
     281        # We can find a student by searching for all kind of name parts
    282282        self.browser.open(self.manage_container_path)
    283283        self.browser.getControl("Search").click()
     
    285285        self.browser.getControl(name="searchtype").value = ['fullname']
    286286        self.browser.getControl(name="searchterm").value = 'Anna Tester'
     287        self.browser.getControl("Search").click()
     288        self.assertTrue('Anna Tester' in self.browser.contents)
     289        self.browser.open(self.manage_container_path)
     290        self.browser.getControl(name="searchtype").value = ['fullname']
     291        self.browser.getControl(name="searchterm").value = 'Anna'
     292        self.browser.getControl("Search").click()
     293        self.assertTrue('Anna Tester' in self.browser.contents)
     294        self.browser.open(self.manage_container_path)
     295        self.browser.getControl(name="searchtype").value = ['fullname']
     296        self.browser.getControl(name="searchterm").value = 'Tester'
     297        self.browser.getControl("Search").click()
     298        self.assertTrue('Anna Tester' in self.browser.contents)
     299        self.browser.open(self.manage_container_path)
     300        self.browser.getControl(name="searchtype").value = ['fullname']
     301        self.browser.getControl(name="searchterm").value = 'An'
     302        self.browser.getControl("Search").click()
     303        self.assertFalse('Anna Tester' in self.browser.contents)
     304        self.browser.open(self.manage_container_path)
     305        self.browser.getControl(name="searchtype").value = ['fullname']
     306        self.browser.getControl(name="searchterm").value = 'An*'
     307        self.browser.getControl("Search").click()
     308        self.assertTrue('Anna Tester' in self.browser.contents)
     309        self.browser.open(self.manage_container_path)
     310        self.browser.getControl(name="searchtype").value = ['fullname']
     311        self.browser.getControl(name="searchterm").value = 'tester'
     312        self.browser.getControl("Search").click()
     313        self.assertTrue('Anna Tester' in self.browser.contents)
     314        self.browser.open(self.manage_container_path)
     315        self.browser.getControl(name="searchtype").value = ['fullname']
     316        self.browser.getControl(name="searchterm").value = 'Tester Ana'
     317        self.browser.getControl("Search").click()
     318        self.assertFalse('Anna Tester' in self.browser.contents)
     319        self.browser.open(self.manage_container_path)
     320        self.browser.getControl(name="searchtype").value = ['fullname']
     321        self.browser.getControl(name="searchterm").value = 'Tester Anna'
    287322        self.browser.getControl("Search").click()
    288323        self.assertTrue('Anna Tester' in self.browser.contents)
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_student.py

    r7351 r7364  
    3939        super(StudentTest, self).setUp()
    4040        self.student = Student()
     41        self.student.firstname = u'Anna'
     42        self.student.lastname = u'Tester'
    4143        self.studycourse = StudentStudyCourse()
    4244        self.studylevel = StudentStudyLevel()
Note: See TracChangeset for help on using the changeset viewer.