forked frompython/pythondotorg
- Notifications
You must be signed in to change notification settings - Fork0
Commitc33a664
fix(python#1701): Events page displays year for events scheduled to start or end at a future year (python#2500)
* Add Methods To Check If Event Starts And Ends This Year* Set Up Templates For Querying Start And End YearsPassed variables to the time_tag template [time_tag.html] that checks if an event was scheduled to start or end with the current year.* Insert New Test Data And Update test_views.pyMore events are created to test particular scenarios of events especially events set to start or end at a future year.* Time Tag Now Shows Year For Events With Details Not Within The Current YearThe time tag now displays the year when an event will occur. This is only for events that have been scheduled to start or end in at a future year. The accompanying functional tests have also been included.* Move All Test Data To Functional TestAll test data concerning the provision of data to serve the functional tests have been moved to the functional test.As it improves readability.All other test data at test_views.py was resetto accommodate for the reduction in number of test data instances.* Functional Test For Displaying Year Of Event For Future Events Now Implemented With Unit Tests* Remove Functional Test For Displaying Year Of Future EventSince the current CI at the main branch does not support selenium [web driver] operations, the functional test which depends on selenium to run has been removed.* Handle Case When Call To Next Event Returns None* Fix Erroneous Addition To Dev RequirementsThis error was introduced in115af08* Refactor Tests For Relevant Year String Rendering At Events Page- Updated the test methods `test_scheduled_to_start_this_year_method` and `test_scheduled_to_end_this_year_method` to better reflect event scheduling edge cases.- Added assertions to verify when events are not scheduled to start or end within the current year.- Utilize `unittest.mock` to clamp down datetime-sensitive tests.---------Co-authored-by: Jacob Coffee <jacob@z7x.org>1 parent691c713 commitc33a664
File tree
5 files changed
+167
-11
lines changed- events
- tests
- templates/events
- includes
5 files changed
+167
-11
lines changedLines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
181 | 181 |
| |
182 | 182 |
| |
183 | 183 |
| |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
184 | 198 |
| |
185 | 199 |
| |
186 | 200 |
| |
|
Lines changed: 60 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
| 2 | + | |
| 3 | + | |
2 | 4 |
| |
3 | 5 |
| |
4 | 6 |
| |
| |||
62 | 64 |
| |
63 | 65 |
| |
64 | 66 |
| |
65 |
| - | |
66 | 67 |
| |
67 | 68 |
| |
68 | 69 |
| |
| |||
186 | 187 |
| |
187 | 188 |
| |
188 | 189 |
| |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + |
Lines changed: 54 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
| 9 | + | |
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
| |||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
21 | 26 |
| |
22 | 27 |
| |
23 | 28 |
| |
| |||
34 | 39 |
| |
35 | 40 |
| |
36 | 41 |
| |
37 |
| - | |
38 | 42 |
| |
39 | 43 |
| |
40 | 44 |
| |
| |||
67 | 71 |
| |
68 | 72 |
| |
69 | 73 |
| |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
70 | 90 |
| |
71 | 91 |
| |
72 | 92 |
| |
73 | 93 |
| |
74 | 94 |
| |
75 | 95 |
| |
76 | 96 |
| |
77 |
| - | |
| 97 | + | |
78 | 98 |
| |
79 | 99 |
| |
80 | 100 |
| |
81 | 101 |
| |
| 102 | + | |
| 103 | + | |
82 | 104 |
| |
83 | 105 |
| |
84 | 106 |
| |
| |||
93 | 115 |
| |
94 | 116 |
| |
95 | 117 |
| |
96 |
| - | |
| 118 | + | |
97 | 119 |
| |
98 | 120 |
| |
99 | 121 |
| |
| |||
189 | 211 |
| |
190 | 212 |
| |
191 | 213 |
| |
192 |
| - | |
| 214 | + | |
193 | 215 |
| |
194 | 216 |
| |
195 | 217 |
| |
196 | 218 |
| |
197 |
| - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
198 | 229 |
| |
199 | 230 |
| |
200 | 231 |
| |
| |||
204 | 235 |
| |
205 | 236 |
| |
206 | 237 |
| |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
207 | 255 |
| |
208 | 256 |
| |
209 | 257 |
| |
|
Lines changed: 10 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
73 | 73 |
| |
74 | 74 |
| |
75 | 75 |
| |
76 |
| - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
77 | 81 |
| |
78 | 82 |
| |
79 | 83 |
| |
| |||
98 | 102 |
| |
99 | 103 |
| |
100 | 104 |
| |
101 |
| - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
102 | 110 |
| |
103 | 111 |
| |
104 | 112 |
| |
|
Lines changed: 29 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
3 | 18 |
| |
4 |
| - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
5 | 32 |
|
0 commit comments
Comments
(0)