diff --git a/openedx/core/djangoapps/user_api/management/tests/test_email_opt_in_list.py b/openedx/core/djangoapps/user_api/management/tests/test_email_opt_in_list.py index 0a6c46050a..0cbd5b3eef 100644 --- a/openedx/core/djangoapps/user_api/management/tests/test_email_opt_in_list.py +++ b/openedx/core/djangoapps/user_api/management/tests/test_email_opt_in_list.py @@ -274,10 +274,14 @@ class EmailOptInListTest(ModuleStoreTestCase): expected_msg_regex = ( "^Error: too few arguments$" ) - else: + elif num_args == 1: expected_msg_regex = ( "^Error: the following arguments are required: ORG_ALIASES$" ) + elif num_args == 0: + expected_msg_regex = ( + "^Error: the following arguments are required: OUTPUT_FILENAME, ORG_ALIASES$" + ) with self.assertRaisesRegexp(CommandError, expected_msg_regex): call_command('email_opt_in_list', *args)