Skip to content

Commit

Permalink
test: add batch test case
Browse files Browse the repository at this point in the history
  • Loading branch information
varshamenon4 committed Jul 30, 2024
1 parent fa873c1 commit ef6be73
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ def test_add_course_staff_with_batch_size_larger_than_list(self):
with self.assertNumQueries(6):
call_command(self.command, f'--csv_path={csv.name}', '--batch_size=3')

def test_add_course_staff_with_batch_size_smaller_than_list(self):
""" Assert that the number of queries is correct given batch size smaller than lines """
lines = ['pam,[email protected],staff,course-v1:edx+test+f20\n',
'sam,[email protected],staff,course-v1:edx+test+f20\n'
'tam,[email protected],staff,course-v1:edx+test+f20\n']
with NamedTemporaryFile() as csv:
csv = self._write_test_csv(csv, lines)
with self.assertNumQueries(9):
call_command(self.command, f'--csv_path={csv.name}', '--batch_size=2')

def test_add_course_staff_with_not_default_batch_delay(self):
username, email = 'pam', '[email protected]'
username2, email2 = 'cam', '[email protected]'
Expand Down

0 comments on commit ef6be73

Please sign in to comment.