Index: main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py	(revision 6649)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py	(revision 6652)
@@ -71,15 +71,13 @@
         setSite(app)
 
-
         # Add student with subobjects (done by addStudent)
         student = Student()
         student.name = u'Anna Tester'
-        student.student_id = u'Z654321'
-        self.app['students'].addStudent(student)
+        self.test_student_id = self.app['students'].addStudent(student)
 
         self.container_path = 'http://localhost/app/students'
         self.manage_container_path = self.container_path + '/@@manage'
         self.add_student_path = self.container_path + '/addstudent'
-        self.student_path = self.container_path + '/Z654321'
+        self.student_path = self.container_path + '/' + self.test_student_id
         self.manage_student_path = self.student_path + '/edit_base'
         self.clearance_student_path = self.student_path + '/view_clearance'
@@ -146,14 +144,7 @@
         self.assertEqual(self.browser.headers['Status'], '200 Ok')
         self.assertEqual(self.browser.url, self.add_student_path)
-        self.browser.getControl(name="form.student_id").value = 'A123456'
         self.browser.getControl(name="form.name").value = 'Bob Tester'
         self.browser.getControl("Create student record").click()
         self.assertTrue('Student record created' in self.browser.contents)
-        self.browser.open(self.manage_container_path)
-        self.browser.getLink("Add student").click()
-        self.browser.getControl(name="form.student_id").value = 'A123456'
-        self.browser.getControl(name="form.name").value = 'Bob Brother'
-        self.browser.getControl("Create student record").click()
-        self.assertTrue('The student id chosen already exists' in self.browser.contents)
 
         self.browser.open(self.container_path)
@@ -161,10 +152,7 @@
         self.assertTrue('Empty search string' in self.browser.contents)
         self.browser.getControl(name="searchtype").value = ['student_id']
-        self.browser.getControl(name="searchterm").value = 'A123456'
-        self.browser.getControl("Search").click()
-        self.assertTrue('Bob Tester' in self.browser.contents)
-        # The old searchterm will be used again
-        self.browser.getControl("Search").click()
-        self.assertTrue('Bob Tester' in self.browser.contents)
+        self.browser.getControl(name="searchterm").value = self.test_student_id
+        self.browser.getControl("Search").click()
+        self.assertTrue('Anna Tester' in self.browser.contents)
 
         self.browser.open(self.manage_container_path)
@@ -172,13 +160,17 @@
         self.assertTrue('Empty search string' in self.browser.contents)
         self.browser.getControl(name="searchtype").value = ['name']
-        self.browser.getControl(name="searchterm").value = 'Bob Tester'
-        self.browser.getControl("Search").click()
-        self.assertTrue('A123456' in self.browser.contents)
+        self.browser.getControl(name="searchterm").value = 'Anna Tester'
+        self.browser.getControl("Search").click()
+        self.assertTrue('Anna Tester' in self.browser.contents)
+        # The old searchterm will be used again
+        self.browser.getControl("Search").click()
+        self.assertTrue('Anna Tester' in self.browser.contents)
+
         ctrl = self.browser.getControl(name='entries')
-        ctrl.getControl(value='A123456').selected = True
+        ctrl.getControl(value=self.test_student_id).selected = True
         self.browser.getControl("Remove selected", index=0).click()
         self.assertTrue('Successfully removed' in self.browser.contents)
         self.browser.getControl(name="searchtype").value = ['student_id']
-        self.browser.getControl(name="searchterm").value = 'A123456'
+        self.browser.getControl(name="searchterm").value = self.test_student_id
         self.browser.getControl("Search").click()
         self.assertTrue('No student found' in self.browser.contents)
@@ -186,5 +178,5 @@
         self.browser.open(self.container_path)
         self.browser.getControl(name="searchtype").value = ['student_id']
-        self.browser.getControl(name="searchterm").value = 'A123456'
+        self.browser.getControl(name="searchterm").value = self.test_student_id
         self.browser.getControl("Search").click()
         self.assertTrue('No student found' in self.browser.contents)
