~replaceafill/ubuntu/trusty/schooltool/2.8_custom-css

« back to all changes in this revision

Viewing changes to src/schooltool/course/browser/stests/propagation.txt

  • Committer: Gediminas Paulauskas
  • Date: 2014-04-18 16:25:33 UTC
  • mfrom: (1.1.33)
  • Revision ID: menesis@pov.lt-20140418162533-noklnc6b89w2epee
Tags: 1:2.7.0-0ubuntu1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Test for section instructor/student propagation to linked sections
 
2
==================================================================
 
3
 
 
4
Log in as manager:
 
5
 
 
6
    >>> manager = browsers.manager
 
7
    >>> manager.ui.login('manager', 'schooltool')
 
8
 
 
9
Set today's date:
 
10
 
 
11
    >>> manager.open('http://localhost/time?value=2014-01-01')
 
12
 
 
13
Create a year with four terms:
 
14
 
 
15
    >>> manager.ui.schoolyear.add('2014', '2014-01-01', '2014-12-31')
 
16
 
 
17
    >>> manager.ui.term.add('2014', 'Q1', '2014-01-01', '2014-03-31')
 
18
    >>> manager.ui.term.add('2014', 'Q2', '2014-04-01', '2014-06-30')
 
19
    >>> manager.ui.term.add('2014', 'Q3', '2014-07-01', '2014-09-30')
 
20
    >>> manager.ui.term.add('2014', 'Q4', '2014-10-01', '2014-12-31')
 
21
 
 
22
Create some people:
 
23
 
 
24
    >>> manager.ui.person.add('Jeffrey', 'Elkner', 'jeffrey', 'schooltool')
 
25
    >>> manager.ui.person.add('David', 'Welsh', 'david', 'schooltool')
 
26
    >>> manager.ui.person.add('Camila', 'Cerna', 'camila', 'schooltool')
 
27
    >>> manager.ui.person.add('Mario', 'Tejada', 'mario', 'schooltool')
 
28
 
 
29
Add a course with a multi-term section:
 
30
 
 
31
    >>> manager.ui.course.add('2014', 'Math')
 
32
 
 
33
    >>> manager.ui.section.add('2014', 'Q1', 'Math', ends='Q4')
 
34
 
 
35
Add instructors and students to the Q1 section:
 
36
 
 
37
    >>> manager.ui.section.instructors.add(
 
38
    ...     '2014', 'Q1', 'Math (1)', instructors=['jeffrey'])
 
39
    >>> manager.ui.section.instructors.add(
 
40
    ...     '2014', 'Q1', 'Math (1)', instructors=['david'],
 
41
    ...     state='Substitute')
 
42
 
 
43
    >>> manager.ui.section.students.add(
 
44
    ...     '2014', 'Q1', 'Math (1)', students=['camila', 'mario'])
 
45
 
 
46
Visit the four linked sections and print their instructors and
 
47
students:
 
48
 
 
49
    >>> manager.ui.section.instructors.print_table('2014', 'Q1', 'Math (1)')
 
50
    +-----------+------------+----------+------------+
 
51
    | Last Name | First Name | Username | Status     |
 
52
    +-----------+------------+----------+------------+
 
53
    | Elkner    | Jeffrey    | jeffrey  | Instructor |
 
54
    | Welsh     | David      | david    | Substitute |
 
55
    +-----------+------------+----------+------------+
 
56
    >>> manager.ui.section.students.print_table('2014', 'Q1', 'Math (1)')
 
57
    +-----------+------------+----------+----------+
 
58
    | Last Name | First Name | Username | Status   |
 
59
    +-----------+------------+----------+----------+
 
60
    | Cerna     | Camila     | camila   | Enrolled |
 
61
    | Tejada    | Mario      | mario    | Enrolled |
 
62
    +-----------+------------+----------+----------+
 
63
 
 
64
    >>> manager.ui.section.instructors.print_table('2014', 'Q2', 'Math (1)')
 
65
    +-----------+------------+----------+------------+
 
66
    | Last Name | First Name | Username | Status     |
 
67
    +-----------+------------+----------+------------+
 
68
    | Elkner    | Jeffrey    | jeffrey  | Instructor |
 
69
    | Welsh     | David      | david    | Substitute |
 
70
    +-----------+------------+----------+------------+
 
71
    >>> manager.ui.section.students.print_table('2014', 'Q2', 'Math (1)')
 
72
    +-----------+------------+----------+----------+
 
73
    | Last Name | First Name | Username | Status   |
 
74
    +-----------+------------+----------+----------+
 
75
    | Cerna     | Camila     | camila   | Enrolled |
 
76
    | Tejada    | Mario      | mario    | Enrolled |
 
77
    +-----------+------------+----------+----------+
 
78
 
 
79
    >>> manager.ui.section.instructors.print_table('2014', 'Q3', 'Math (1)')
 
80
    +-----------+------------+----------+------------+
 
81
    | Last Name | First Name | Username | Status     |
 
82
    +-----------+------------+----------+------------+
 
83
    | Elkner    | Jeffrey    | jeffrey  | Instructor |
 
84
    | Welsh     | David      | david    | Substitute |
 
85
    +-----------+------------+----------+------------+
 
86
    >>> manager.ui.section.students.print_table('2014', 'Q3', 'Math (1)')
 
87
    +-----------+------------+----------+----------+
 
88
    | Last Name | First Name | Username | Status   |
 
89
    +-----------+------------+----------+----------+
 
90
    | Cerna     | Camila     | camila   | Enrolled |
 
91
    | Tejada    | Mario      | mario    | Enrolled |
 
92
    +-----------+------------+----------+----------+
 
93
 
 
94
    >>> manager.ui.section.instructors.print_table('2014', 'Q4', 'Math (1)')
 
95
    +-----------+------------+----------+------------+
 
96
    | Last Name | First Name | Username | Status     |
 
97
    +-----------+------------+----------+------------+
 
98
    | Elkner    | Jeffrey    | jeffrey  | Instructor |
 
99
    | Welsh     | David      | david    | Substitute |
 
100
    +-----------+------------+----------+------------+
 
101
    >>> manager.ui.section.students.print_table('2014', 'Q4', 'Math (1)')
 
102
    +-----------+------------+----------+----------+
 
103
    | Last Name | First Name | Username | Status   |
 
104
    +-----------+------------+----------+----------+
 
105
    | Cerna     | Camila     | camila   | Enrolled |
 
106
    | Tejada    | Mario      | mario    | Enrolled |
 
107
    +-----------+------------+----------+----------+
 
108
 
 
109
Let's modify today's date:
 
110
 
 
111
    >>> manager.open('http://localhost/time?value=2014-01-02')
 
112
 
 
113
Now, let's remove an instructor from the Q2 section and a student from
 
114
the Q3 section:
 
115
 
 
116
    >>> manager.ui.section.instructors.remove(
 
117
    ...     '2014', 'Q2', 'Math (1)', instructors=['david'])
 
118
 
 
119
    >>> manager.ui.section.students.remove(
 
120
    ...     '2014', 'Q3', 'Math (1)', students=['camila'])
 
121
 
 
122
Let's print all the tables again to see the changes propagated:
 
123
 
 
124
    >>> manager.ui.section.instructors.print_table('2014', 'Q1', 'Math (1)')
 
125
    +-----------+------------+----------+------------+
 
126
    | Last Name | First Name | Username | Status     |
 
127
    +-----------+------------+----------+------------+
 
128
    | Elkner    | Jeffrey    | jeffrey  | Instructor |
 
129
    | Welsh     | David      | david    | Substitute |
 
130
    +-----------+------------+----------+------------+
 
131
    >>> manager.ui.section.students.print_table('2014', 'Q1', 'Math (1)')
 
132
    +-----------+------------+----------+----------+
 
133
    | Last Name | First Name | Username | Status   |
 
134
    +-----------+------------+----------+----------+
 
135
    | Cerna     | Camila     | camila   | Enrolled |
 
136
    | Tejada    | Mario      | mario    | Enrolled |
 
137
    +-----------+------------+----------+----------+
 
138
 
 
139
    >>> manager.ui.section.instructors.print_table('2014', 'Q2', 'Math (1)')
 
140
    +-----------+------------+----------+------------+
 
141
    | Last Name | First Name | Username | Status     |
 
142
    +-----------+------------+----------+------------+
 
143
    | Elkner    | Jeffrey    | jeffrey  | Instructor |
 
144
    | Welsh     | David      | david    | Withdrawn  |
 
145
    +-----------+------------+----------+------------+
 
146
    >>> manager.ui.section.students.print_table('2014', 'Q2', 'Math (1)')
 
147
    +-----------+------------+----------+----------+
 
148
    | Last Name | First Name | Username | Status   |
 
149
    +-----------+------------+----------+----------+
 
150
    | Cerna     | Camila     | camila   | Enrolled |
 
151
    | Tejada    | Mario      | mario    | Enrolled |
 
152
    +-----------+------------+----------+----------+
 
153
 
 
154
    >>> manager.ui.section.instructors.print_table('2014', 'Q3', 'Math (1)')
 
155
    +-----------+------------+----------+------------+
 
156
    | Last Name | First Name | Username | Status     |
 
157
    +-----------+------------+----------+------------+
 
158
    | Elkner    | Jeffrey    | jeffrey  | Instructor |
 
159
    | Welsh     | David      | david    | Withdrawn  |
 
160
    +-----------+------------+----------+------------+
 
161
    >>> manager.ui.section.students.print_table('2014', 'Q3', 'Math (1)')
 
162
    +-----------+------------+----------+-----------+
 
163
    | Last Name | First Name | Username | Status    |
 
164
    +-----------+------------+----------+-----------+
 
165
    | Cerna     | Camila     | camila   | Withdrawn |
 
166
    | Tejada    | Mario      | mario    | Enrolled  |
 
167
    +-----------+------------+----------+-----------+
 
168
 
 
169
    >>> manager.ui.section.instructors.print_table('2014', 'Q4', 'Math (1)')
 
170
    +-----------+------------+----------+------------+
 
171
    | Last Name | First Name | Username | Status     |
 
172
    +-----------+------------+----------+------------+
 
173
    | Elkner    | Jeffrey    | jeffrey  | Instructor |
 
174
    | Welsh     | David      | david    | Withdrawn  |
 
175
    +-----------+------------+----------+------------+
 
176
    >>> manager.ui.section.students.print_table('2014', 'Q4', 'Math (1)')
 
177
    +-----------+------------+----------+-----------+
 
178
    | Last Name | First Name | Username | Status    |
 
179
    +-----------+------------+----------+-----------+
 
180
    | Cerna     | Camila     | camila   | Withdrawn |
 
181
    | Tejada    | Mario      | mario    | Enrolled  |
 
182
    +-----------+------------+----------+-----------+
 
183
 
 
184
Now, let's add a new student to the Q1 section as Pending today but
 
185
who becomes Enrolled next week for section Q3:
 
186
 
 
187
    >>> manager.ui.person.add('Nestor', 'Guzman', 'nestor', 'schooltool')
 
188
    >>> manager.ui.section.students.add(
 
189
    ...     '2014', 'Q1', 'Math (1)', students=['nestor'], state='Pending')
 
190
    >>> manager.ui.section.students.remove(
 
191
    ...     '2014', 'Q3', 'Math (1)', ['nestor'], 'Enrolled', '2014-01-07')
 
192
 
 
193
Let's print all the student tables again:
 
194
 
 
195
    >>> manager.ui.section.students.print_table('2014', 'Q1', 'Math (1)')
 
196
    +-----------+------------+----------+----------+
 
197
    | Last Name | First Name | Username | Status   |
 
198
    +-----------+------------+----------+----------+
 
199
    | Cerna     | Camila     | camila   | Enrolled |
 
200
    | Guzman    | Nestor     | nestor   | Pending  |
 
201
    | Tejada    | Mario      | mario    | Enrolled |
 
202
    +-----------+------------+----------+----------+
 
203
 
 
204
    >>> manager.ui.section.students.print_table('2014', 'Q2', 'Math (1)')
 
205
    +-----------+------------+----------+----------+
 
206
    | Last Name | First Name | Username | Status   |
 
207
    +-----------+------------+----------+----------+
 
208
    | Cerna     | Camila     | camila   | Enrolled |
 
209
    | Guzman    | Nestor     | nestor   | Pending  |
 
210
    | Tejada    | Mario      | mario    | Enrolled |
 
211
    +-----------+------------+----------+----------+
 
212
 
 
213
    >>> manager.ui.section.students.print_table('2014', 'Q3', 'Math (1)')
 
214
    +-----------+------------+----------+-----------+
 
215
    | Last Name | First Name | Username | Status    |
 
216
    +-----------+------------+----------+-----------+
 
217
    | Cerna     | Camila     | camila   | Withdrawn |
 
218
    | Guzman    | Nestor     | nestor   | Pending   |
 
219
    | Tejada    | Mario      | mario    | Enrolled  |
 
220
    +-----------+------------+----------+-----------+
 
221
 
 
222
    >>> manager.ui.section.students.print_table('2014', 'Q4', 'Math (1)')
 
223
    +-----------+------------+----------+-----------+
 
224
    | Last Name | First Name | Username | Status    |
 
225
    +-----------+------------+----------+-----------+
 
226
    | Cerna     | Camila     | camila   | Withdrawn |
 
227
    | Guzman    | Nestor     | nestor   | Pending   |
 
228
    | Tejada    | Mario      | mario    | Enrolled  |
 
229
    +-----------+------------+----------+-----------+
 
230
 
 
231
Let's change today's date again:
 
232
 
 
233
    >>> manager.open('http://localhost/time?value=2014-01-07')
 
234
 
 
235
If we print the tables we'll see that Nestor became enrolled in the Q3
 
236
and Q4 sections:
 
237
 
 
238
    >>> manager.ui.section.students.print_table('2014', 'Q1', 'Math (1)')
 
239
    +-----------+------------+----------+----------+
 
240
    | Last Name | First Name | Username | Status   |
 
241
    +-----------+------------+----------+----------+
 
242
    | Cerna     | Camila     | camila   | Enrolled |
 
243
    | Guzman    | Nestor     | nestor   | Pending  |
 
244
    | Tejada    | Mario      | mario    | Enrolled |
 
245
    +-----------+------------+----------+----------+
 
246
 
 
247
    >>> manager.ui.section.students.print_table('2014', 'Q2', 'Math (1)')
 
248
    +-----------+------------+----------+----------+
 
249
    | Last Name | First Name | Username | Status   |
 
250
    +-----------+------------+----------+----------+
 
251
    | Cerna     | Camila     | camila   | Enrolled |
 
252
    | Guzman    | Nestor     | nestor   | Pending  |
 
253
    | Tejada    | Mario      | mario    | Enrolled |
 
254
    +-----------+------------+----------+----------+
 
255
 
 
256
    >>> manager.ui.section.students.print_table('2014', 'Q3', 'Math (1)')
 
257
    +-----------+------------+----------+-----------+
 
258
    | Last Name | First Name | Username | Status    |
 
259
    +-----------+------------+----------+-----------+
 
260
    | Cerna     | Camila     | camila   | Withdrawn |
 
261
    | Guzman    | Nestor     | nestor   | Enrolled  |
 
262
    | Tejada    | Mario      | mario    | Enrolled  |
 
263
    +-----------+------------+----------+-----------+
 
264
 
 
265
    >>> manager.ui.section.students.print_table('2014', 'Q4', 'Math (1)')
 
266
    +-----------+------------+----------+-----------+
 
267
    | Last Name | First Name | Username | Status    |
 
268
    +-----------+------------+----------+-----------+
 
269
    | Cerna     | Camila     | camila   | Withdrawn |
 
270
    | Guzman    | Nestor     | nestor   | Enrolled  |
 
271
    | Tejada    | Mario      | mario    | Enrolled  |
 
272
    +-----------+------------+----------+-----------+