From cc4050460e8424455b6fbf17fff9e60bbaedf23c Mon Sep 17 00:00:00 2001 From: Ayub khan Date: Mon, 30 Sep 2019 14:42:55 +0500 Subject: [PATCH 1/2] BOM-882 python3 compatibility --- .../management/tests/test_email_opt_in_list.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 34fdc188b3..0a6c46050a 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,14 @@ 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$" + ) + else: + expected_msg_regex = ( + "^Error: the following arguments are required: ORG_ALIASES$" + ) with self.assertRaisesRegexp(CommandError, expected_msg_regex): call_command('email_opt_in_list', *args) From 86bd5a4643c57f6bae4daa03a6f9af1140caa6ef Mon Sep 17 00:00:00 2001 From: Ayub khan Date: Mon, 30 Sep 2019 14:58:12 +0500 Subject: [PATCH 2/2] BOM-881 python3 compatibility --- .../user_api/management/tests/test_email_opt_in_list.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)