240
240
The links are for the view only views.
242
242
>>> principal.getLink('Intervention').click()
243
>>> principal.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
244
<a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1">x</a>
245
<a href="http://localhost/persons/student2/schoolyears/2005-2006/goals/1">x</a>
246
<a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/2">x</a>
247
<a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/1">x</a>
248
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2">x</a>
249
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/1">x</a>
243
>>> principal.printQuery("id('content-body')//table/tbody//a")
244
<a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1...
245
<a href="http://localhost/persons/student2/schoolyears/2005-2006/goals/1...
246
<a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/2...
247
<a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/1...
248
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2...
249
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/1...
251
251
>>> teacher1.getLink('Intervention').click()
252
>>> teacher1.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
253
<a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1">x</a>
254
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2">x</a>
252
>>> teacher1.printQuery("id('content-body')//table/tbody//a")
253
<a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1...
254
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2...
256
256
>>> student1.getLink('Intervention').click()
257
>>> student1.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
258
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/1">x</a>
257
>>> student1.printQuery("id('content-body')//table/tbody//a")
258
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/1...
260
260
>>> student2.getLink('Intervention').click()
261
>>> student2.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
262
<a href="http://localhost/persons/student2/schoolyears/2005-2006/goals/1">x</a>
263
<a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/1">x</a>
261
>>> student2.printQuery("id('content-body')//table/tbody//a")
262
<a href="http://localhost/persons/student2/schoolyears/2005-2006/goals/1...
263
<a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/1...
265
265
>>> student3.getLink('Intervention').click()
266
>>> student3.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
267
<a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1">x</a>
266
>>> student3.printQuery("id('content-body')//table/tbody//a")
267
<a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1...
269
269
There is a name filter that can limit the list to students whose name contains
272
272
>>> principal.getControl(name='SEARCH_NAME').value = 'student1'
273
273
>>> principal.getControl(name='SEARCH_BUTTON').click()
274
>>> principal.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
275
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2">x</a>
276
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/1">x</a>
274
>>> principal.printQuery("id('content-body')//table/tbody//a")
275
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2...
276
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/1...
278
278
>>> principal.getControl(name='SEARCH_NAME').value = 'student2'
279
279
>>> principal.getControl(name='SEARCH_BUTTON').click()
280
>>> principal.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
281
<a href="http://localhost/persons/student2/schoolyears/2005-2006/goals/1">x</a>
282
<a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/2">x</a>
283
<a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/1">x</a>
280
>>> principal.printQuery("id('content-body')//table/tbody//a")
281
<a href="http://localhost/persons/student2/schoolyears/2005-2006/goals/1...
282
<a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/2...
283
<a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/1...
285
285
>>> principal.getControl(name='SEARCH_NAME').value = 'student3'
286
286
>>> principal.getControl(name='SEARCH_BUTTON').click()
287
>>> principal.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
288
<a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1">x</a>
287
>>> principal.printQuery("id('content-body')//table/tbody//a")
288
<a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1...
290
290
We have a Clear button that restores the search criteria to empty, thus
291
291
returning all messages and goals again.
293
293
>>> principal.getControl(name='CLEAR_SEARCH').click()
294
>>> principal.getControl(name='SEARCH_BUTTON').click()
295
>>> principal.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
296
<a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1">x</a>
297
<a href="http://localhost/persons/student2/schoolyears/2005-2006/goals/1">x</a>
298
<a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/2">x</a>
299
<a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/1">x</a>
300
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2">x</a>
301
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/1">x</a>
294
>>> principal.printQuery("id('content-body')//table/tbody//a")
295
<a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1...
296
<a href="http://localhost/persons/student2/schoolyears/2005-2006/goals/1...
297
<a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/2...
298
<a href="http://localhost/persons/student2/schoolyears/2005-2006/messages/1...
299
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2...
300
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/1...
303
302
Finally, by clicking the Goals Only checkbox the search results will be limited
304
303
to students that have goals, in our case, student2 and student3.
306
305
>>> principal.getControl(name='GOALS_ONLY').value = 'checked'
307
306
>>> principal.getControl(name='SEARCH_BUTTON').click()
308
>>> principal.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
309
<a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1">x</a>
310
<a href="http://localhost/persons/student2/schoolyears/2005-2006/goals/1">x</a>
307
>>> principal.printQuery("id('content-body')//table/tbody//a")
308
<a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1...
309
<a href="http://localhost/persons/student2/schoolyears/2005-2006/goals/1...
313
312
UpdatePersonResponsibleIndex() tests
323
322
>>> ftests.addEditGoal(principal, edit_goal_url, ['principal', 'student3'])
325
324
>>> teacher1.getLink('Intervention').click()
326
>>> teacher1.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
327
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2">x</a>
325
>>> teacher1.printQuery("id('content-body')//table/tbody//a")
326
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2...
329
328
>>> ftests.addEditGoal(principal, edit_goal_url, ['principal', 'teacher1', 'student3'])
331
330
>>> teacher1.getLink('Intervention').click()
332
>>> teacher1.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
333
<a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1">x</a>
334
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2">x</a>
331
>>> teacher1.printQuery("id('content-body')//table/tbody//a")
332
<a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1...
333
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2...
336
335
Now we need to test that the same behaviour will occur if an as yet non-existent
337
336
view (we'll provide a test-only version) changes a message's recipients or a
346
345
>>> principal.open(message_url + '?remove=teacher1')
347
346
>>> teacher1.getLink('Intervention').click()
348
>>> teacher1.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
349
<a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1">x</a>
347
>>> teacher1.printQuery("id('content-body')//table/tbody//a")
348
<a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1...
351
350
We'll add the teacher back to the message. The teacher's inbox should now
352
351
have the message again.
354
353
>>> principal.open(message_url + '?add=teacher1')
355
354
>>> teacher1.getLink('Intervention').click()
356
>>> teacher1.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
357
<a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1">x</a>
358
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2">x</a>
355
>>> teacher1.printQuery("id('content-body')//table/tbody//a")
356
<a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1...
357
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2...
360
359
We'll do the same two sets of tests for the goal.
362
361
>>> principal.open(goal_url + '?remove=teacher1')
363
362
>>> teacher1.getLink('Intervention').click()
364
>>> teacher1.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
365
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2">x</a>
363
>>> teacher1.printQuery("id('content-body')//table/tbody//a")
364
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2...
367
366
>>> principal.open(goal_url + '?add=teacher1')
368
367
>>> teacher1.getLink('Intervention').click()
369
>>> teacher1.printQuery("id('content-body')/div/form/fieldset[2]/div/table/tbody//a")
370
<a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1">x</a>
371
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2">x</a>
368
>>> teacher1.printQuery("id('content-body')//table/tbody//a")
369
<a href="http://localhost/persons/student3/schoolyears/2005-2006/goals/1...
370
<a href="http://localhost/persons/student1/schoolyears/2005-2006/messages/2...
374
373
Traversal adapter tests