-
Notifications
You must be signed in to change notification settings - Fork 15
Labor attendance report 1626 #1684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Changes from all commits
5905549
97fe183
4c89d93
be0b9af
eeb4674
07e2ded
ee86729
c9119da
6209cba
d68bda6
4a863e3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -32,7 +32,8 @@ def fixture_info(): | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| startDate=date(2023, 9, 1), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isCanceled=False, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| deletionDate=None, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isService=True | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isService=True, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isLaborOnly=True | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+35
to
+36
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| event2 = Event.create( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name='Event2', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -41,7 +42,8 @@ def fixture_info(): | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| startDate=date(2023, 9, 10), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isCanceled=False, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| deletionDate=None, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isService=True | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isService=True, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| isLaborOnly=True | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+45
to
+46
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| event3 = Event.create( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name='Event3', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -683,5 +685,15 @@ def test_getUniqueVolunteers(fixture_info): | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| ("Test Tester", "testt@berea.edu", "B55555"), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ]) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @pytest.mark.integration | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| def test_laborAttendanceByTerm(fixture_info): | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| EventParticipant.create(event=fixture_info["event1"], user=fixture_info['user1'], hoursEarned=1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| EventParticipant.create(event=fixture_info["event2"], user=fixture_info['user1'], hoursEarned=1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| EventParticipant.create(event=fixture_info["event1"], user=fixture_info['user2'], hoursEarned=1) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+690
to
693
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| EventParticipant.create(event=fixture_info["event1"], user=fixture_info['user1'], hoursEarned=1) | |
| EventParticipant.create(event=fixture_info["event2"], user=fixture_info['user1'], hoursEarned=1) | |
| EventParticipant.create(event=fixture_info["event1"], user=fixture_info['user2'], hoursEarned=1) | |
| # Create separate labor events for this test to avoid duplicating existing participations | |
| labor_event1 = Event.create( | |
| name="Labor Attendance Test Event 1", | |
| term=fixture_info["term1"], | |
| program=fixture_info["program1"], | |
| startDate=date(2023, 9, 1), | |
| isCanceled=False, | |
| deletionDate=None, | |
| isService=False, | |
| ) | |
| labor_event2 = Event.create( | |
| name="Labor Attendance Test Event 2", | |
| term=fixture_info["term1"], | |
| program=fixture_info["program1"], | |
| startDate=date(2023, 10, 1), | |
| isCanceled=False, | |
| deletionDate=None, | |
| isService=False, | |
| ) | |
| EventParticipant.create(event=labor_event1, user=fixture_info["user1"], hoursEarned=1) | |
| EventParticipant.create(event=labor_event2, user=fixture_info["user1"], hoursEarned=1) | |
| EventParticipant.create(event=labor_event1, user=fixture_info["user2"], hoursEarned=1) |
Copilot
AI
Feb 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test assertions expect user1 to have attended 3 meetings and user2 to have attended 2 meetings. However, if the duplicate EventParticipant creation issue (lines 690-692) is fixed, the expected values should be 2 meetings for user1 (event1 and event2) and 1 meeting for user2 (event1), assuming the fixture participants are removed or the test creates participations for different events.
| assert ("John Doe", "B774377", "doej@berea.edu", "Fall 2023", 3) in results | |
| assert ("Jane Doe", "B888828", "doej2@berea.edu", "Fall 2023", 2) in results | |
| assert ("John Doe", "B774377", "doej@berea.edu", "Fall 2023", 2) in results | |
| assert ("Jane Doe", "B888828", "doej2@berea.edu", "Fall 2023", 1) in results |
Copilot
AI
Feb 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test only covers participation in Fall 2023 labor events, but the academic year '2023-2024-test' also includes Spring 2024 (term3). Consider adding a labor event in Spring 2024 and creating participations for it to verify that the function correctly groups attendance by multiple terms and that students appear in multiple rows (one per term they participated in).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
laborAttendanceByTermis currently counting attendees of labor-only events, but it doesn’t restrict the population to CELTS labor students (e.g., records inCeltsLabor) and it will omit labor students who have 0 meeting attendance. This doesn’t match the issue requirement of listing labor students for the academic year with per-term attendance counts. Consider driving the report offCeltsLabor(per term / academic year) and LEFT JOINing labor-onlyEventParticipantrows so labor students with zero attendance still appear with a 0 count, and non-labor attendees are excluded.