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 34fdc188b36956c4d0601f66920d346b4f87bf4d..0cbd5b3eef66bc6c23bcfcf3bc8d9da1a4e17535 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 @@ -270,9 +270,18 @@ class EmailOptInListTest(ModuleStoreTestCase): @ddt.data(0, 1) def test_not_enough_args(self, num_args): args = ["dummy"] * num_args - expected_msg_regex = ( - "^Error: too few arguments$" - ) + if six.PY2: + expected_msg_regex = ( + "^Error: too few arguments$" + ) + 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)