TEST_NAME = "students:delete" def run(context) -> None: path = f"/api/students/{context.student_one_id}" status, _, _ = context.send_request("DELETE", path) context.expect(status == 401, f"expected 401, got {status}") status, _, _ = context.send_request( "DELETE", f"/api/students/{context.student_one_id + 999}", headers=context.make_auth( context.teacher_username, context.teacher_password, ), ) context.expect(status == 404, f"expected 404, got {status}") status, _, _ = context.send_request( "DELETE", path, headers=context.make_auth( context.teacher_username, context.teacher_password, ), ) context.expect(status == 204, f"expected 204, got {status}") status, _, _ = context.send_request( "GET", path, headers=context.make_auth( context.teacher_username, context.teacher_password, ), ) context.expect(status == 404, f"expected 404 after delete, got {status}") context.student_one_id = None