From 37daf7a2c21502edf64655c1236a5423927284d8 Mon Sep 17 00:00:00 2001 From: Varsha Menon Date: Wed, 27 Mar 2024 21:37:49 -0400 Subject: [PATCH] test: update user check --- .../management/commands/test/test_bulk_add_course_staff.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/edx_exams/apps/core/management/commands/test/test_bulk_add_course_staff.py b/edx_exams/apps/core/management/commands/test/test_bulk_add_course_staff.py index e9cb910c..3dc962e2 100644 --- a/edx_exams/apps/core/management/commands/test/test_bulk_add_course_staff.py +++ b/edx_exams/apps/core/management/commands/test/test_bulk_add_course_staff.py @@ -61,10 +61,10 @@ def test_add_course_staff_with_new_user(self): with NamedTemporaryFile() as csv: csv = self._write_test_csv(csv, lines) call_command(self.command, f'--csv_path={csv.name}') - user = User.objects.filter(username=username, email=email)[0] + user = User.objects.filter(username=username, email=email) assert user.exists() assert CourseStaffRole.objects.filter( - user=user.id, + user=user[0].id, course_id=self.course_id, role=self.course_role, ).exists()