Add a working-date selector to the instructor home page
Everything on the home page — availability counts, live mode, the calls editor, and list generation — now targets a selectable working date instead of being fixed to today, with quick links to upcoming scheduled class days. Printing tomorrow's list a day in advance is just switching the date and generating; other days' data is untouched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -69,7 +69,7 @@ def test_regenerate_replaces_pending_and_labels_change(instructor):
|
||||
|
||||
instructor.post(f"/instructor/day/{TODAY}/generate", data={"n": "12"})
|
||||
page = instructor.get("/instructor/").get_data(as_text=True)
|
||||
assert "View today's list" in page
|
||||
assert f"View the list for {TODAY}" in page
|
||||
assert "Regenerate list" in page
|
||||
|
||||
# Regenerating replaces the unused list outright.
|
||||
@@ -95,6 +95,26 @@ def test_regenerate_replaces_pending_and_labels_change(instructor):
|
||||
assert "already have recorded outcomes" in page
|
||||
|
||||
|
||||
def test_home_working_date_override(instructor):
|
||||
tomorrow = (
|
||||
datetime.date.today() + datetime.timedelta(days=1)
|
||||
).isoformat()
|
||||
page = instructor.get(f"/instructor/?date={tomorrow}").get_data(as_text=True)
|
||||
assert f"available on {tomorrow}" in page
|
||||
assert f"Generate list for {tomorrow}" in page
|
||||
assert "back to today" in page
|
||||
|
||||
# Generate tomorrow's list a day in advance; today stays untouched.
|
||||
resp = instructor.post(
|
||||
f"/instructor/day/{tomorrow}/generate",
|
||||
data={"n": "5"},
|
||||
follow_redirects=True,
|
||||
)
|
||||
assert resp.get_data(as_text=True).count("<tr>") == 6
|
||||
page = instructor.get(f"/instructor/day/{TODAY}/print").get_data(as_text=True)
|
||||
assert "No call list has been generated" in page
|
||||
|
||||
|
||||
def test_add_call_after_the_fact(instructor):
|
||||
page = instructor.get(f"/instructor/day/{TODAY}").get_data(as_text=True)
|
||||
student_id = re.search(r'<option value="(\d+)">', page).group(1)
|
||||
|
||||
Reference in New Issue
Block a user