/usr/lib/python2.7/dist-packages/schooltool/gradebook/browser/ftests/activity_dates.txt is in python-schooltool.gradebook 2.6.3-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | due_date and date attributes of activities
------------------------------------------
We'll test the functional logic of two attributes of activities:
due_date and date.
Log in as manager:
>>> manager = Browser('manager', 'schooltool')
Add a schoolyear:
>>> from schooltool.app.browser.ftests import setup
>>> setup.addSchoolYear('2011', '2011-01-01', '2011-12-31')
Add a term to the schoolyear:
>>> setup.addTerm('Term', '2011-01-01', '2011-12-31', '2011')
Set up one course:
>>> setup.addCourse('Soccer', '2011')
Set up persons:
>>> from schooltool.basicperson.browser.ftests.setup import addPerson
>>> addPerson('Mario', 'Tejada', 'mario', 'pwd', browser=manager)
>>> addPerson('Camila', 'Cerna', 'camila', 'pwd', browser=manager)
>>> addPerson('Nestor', 'Guzman', 'nestor', 'pwd', browser=manager)
>>> addPerson('William', 'Mejia', 'william', 'pwd', browser=manager)
Set up a section:
>>> setup.addSection('Soccer', '2011', 'Term',
... instructors=['William'],
... members=['Mario', 'Camila', 'Nestor'])
We'll change the date of the system to May 25th, 2011:
>>> manager.open('http://localhost/time')
>>> manager.getControl('Today').value = "2011-05-25"
>>> manager.getControl('Apply').click()
>>> manager.printQuery('//div[@class="summary"]/text()')
Data successfully updated.
Log in as teacher:
>>> teacher = Browser('william', 'pwd')
Go to his gradebook:
>>> teacher.getLink('Gradebook').click()
By default the New Activity form shows the system date in the Due Date field:
>>> teacher.getLink('New Activity').click()
>>> teacher.printQuery('id("form-widgets-due_date")/@value')
2011-05-25
>>> teacher.getControl('Title').value = 'My First Activity'
>>> teacher.getControl('Due Date').value = '2011-06-17'
>>> teacher.getControl('Add').click()
The Edit activity form should show the stored due date instead of the
system date:
>>> teacher.getLink('Manage Worksheet').click()
>>> teacher.getLink('My First Activity').click()
>>> teacher.printQuery('id("form-widgets-due_date")/@value')
2011-06-17
The same due_date logic applies to the New External Activity and Edit
external activity forms:
>>> teacher.getControl('Cancel').click()
>>> teacher.getLink('New External Activity').click()
>>> teacher.printQuery('id("form-widgets-due_date")/@value')
2011-05-25
>>> teacher.getControl('External Activity').displayValue = ['Sample Source - HTML']
>>> teacher.getControl('Due Date').value = '2011-07-01'
>>> teacher.getControl('Points').value = '20'
>>> teacher.getControl('Add').click()
>>> teacher.getLink('Manage Worksheet').click()
>>> teacher.getLink('HTML').click()
>>> teacher.printQuery('id("form-widgets-due_date")/@value')
2011-07-01
# XXX: add ftests for Activity.date
|