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()