From 0d3346d2ef9cae4ff7bce0bc3d6628d4c360508e Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Mon, 6 May 2024 15:32:09 -0500 Subject: [PATCH 01/31] feat: add test integration --- eox_hooks/tests/test_integration.py | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 eox_hooks/tests/test_integration.py diff --git a/eox_hooks/tests/test_integration.py b/eox_hooks/tests/test_integration.py new file mode 100644 index 0000000..5b850df --- /dev/null +++ b/eox_hooks/tests/test_integration.py @@ -0,0 +1,48 @@ +""" +Test views file. +""" +from django.test import TestCase +from unittest.mock import patch, MagicMock +from eox_hooks.actions import post_to_webhook_url + + +class TutorIntegrationTestCase(TestCase): + """ + POC code to run tests that cover the integration with openedx + """ + + def test_runs_code(self): + """ + Just to make sure our test infrastructure is behaving + """ + assert True + + # pylint: disable=import-outside-toplevel,unused-import + def test_current_settings_code_imports(self): + """ + Running this imports means that our backends import the right signature + """ + import eox_hooks.edxapp_wrapper.backends.course_modes_j_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.course_modes_l_v1_test # isort:skip + import eox_hooks.edxapp_wrapper.backends.course_modes_l_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.courses_j_v1_test # isort:skip + import eox_hooks.edxapp_wrapper.backends.courses_j_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.courses_l_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.courses_p_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.enrollments_l_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.enrollments_l_v1_test # isort:skip + import eox_hooks.edxapp_wrapper.backends.enrollments_j_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.models_j_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.models_l_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.models_l_v1_test # isort:skip + +class TestPostToWebhook(TestCase): + @patch('eox_hooks.actions.requests.post') # Mock de la función requests.post + def test_post_to_webhook_url(self, mock_post): + mock_trigger_event = "trigger_event" + + mock_post.return_value = MagicMock(status_code=200) # Simula una respuesta exitosa + + result = post_to_webhook_url(trigger_event=mock_trigger_event) + + self.assertTrue(result) From d7ef12de3d47e8ddd3ade0425f2e0293ed08abb5 Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Mon, 6 May 2024 15:40:54 -0500 Subject: [PATCH 02/31] fix: remove commit --- eox_hooks/tests/test_integration.py | 48 ----------------------------- 1 file changed, 48 deletions(-) delete mode 100644 eox_hooks/tests/test_integration.py diff --git a/eox_hooks/tests/test_integration.py b/eox_hooks/tests/test_integration.py deleted file mode 100644 index 5b850df..0000000 --- a/eox_hooks/tests/test_integration.py +++ /dev/null @@ -1,48 +0,0 @@ -""" -Test views file. -""" -from django.test import TestCase -from unittest.mock import patch, MagicMock -from eox_hooks.actions import post_to_webhook_url - - -class TutorIntegrationTestCase(TestCase): - """ - POC code to run tests that cover the integration with openedx - """ - - def test_runs_code(self): - """ - Just to make sure our test infrastructure is behaving - """ - assert True - - # pylint: disable=import-outside-toplevel,unused-import - def test_current_settings_code_imports(self): - """ - Running this imports means that our backends import the right signature - """ - import eox_hooks.edxapp_wrapper.backends.course_modes_j_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.course_modes_l_v1_test # isort:skip - import eox_hooks.edxapp_wrapper.backends.course_modes_l_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.courses_j_v1_test # isort:skip - import eox_hooks.edxapp_wrapper.backends.courses_j_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.courses_l_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.courses_p_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.enrollments_l_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.enrollments_l_v1_test # isort:skip - import eox_hooks.edxapp_wrapper.backends.enrollments_j_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.models_j_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.models_l_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.models_l_v1_test # isort:skip - -class TestPostToWebhook(TestCase): - @patch('eox_hooks.actions.requests.post') # Mock de la función requests.post - def test_post_to_webhook_url(self, mock_post): - mock_trigger_event = "trigger_event" - - mock_post.return_value = MagicMock(status_code=200) # Simula una respuesta exitosa - - result = post_to_webhook_url(trigger_event=mock_trigger_event) - - self.assertTrue(result) From 2a47d0485ea5a7b003f54de53620cd3937b518f6 Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Mon, 6 May 2024 15:44:21 -0500 Subject: [PATCH 03/31] feat: add test integration --- eox_hooks/tests/test_integration.py | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 eox_hooks/tests/test_integration.py diff --git a/eox_hooks/tests/test_integration.py b/eox_hooks/tests/test_integration.py new file mode 100644 index 0000000..5b850df --- /dev/null +++ b/eox_hooks/tests/test_integration.py @@ -0,0 +1,48 @@ +""" +Test views file. +""" +from django.test import TestCase +from unittest.mock import patch, MagicMock +from eox_hooks.actions import post_to_webhook_url + + +class TutorIntegrationTestCase(TestCase): + """ + POC code to run tests that cover the integration with openedx + """ + + def test_runs_code(self): + """ + Just to make sure our test infrastructure is behaving + """ + assert True + + # pylint: disable=import-outside-toplevel,unused-import + def test_current_settings_code_imports(self): + """ + Running this imports means that our backends import the right signature + """ + import eox_hooks.edxapp_wrapper.backends.course_modes_j_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.course_modes_l_v1_test # isort:skip + import eox_hooks.edxapp_wrapper.backends.course_modes_l_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.courses_j_v1_test # isort:skip + import eox_hooks.edxapp_wrapper.backends.courses_j_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.courses_l_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.courses_p_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.enrollments_l_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.enrollments_l_v1_test # isort:skip + import eox_hooks.edxapp_wrapper.backends.enrollments_j_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.models_j_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.models_l_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.models_l_v1_test # isort:skip + +class TestPostToWebhook(TestCase): + @patch('eox_hooks.actions.requests.post') # Mock de la función requests.post + def test_post_to_webhook_url(self, mock_post): + mock_trigger_event = "trigger_event" + + mock_post.return_value = MagicMock(status_code=200) # Simula una respuesta exitosa + + result = post_to_webhook_url(trigger_event=mock_trigger_event) + + self.assertTrue(result) From 12ac7db5ed731be23dfd2a2dda635ecd8691b4d9 Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Mon, 6 May 2024 16:01:03 -0500 Subject: [PATCH 04/31] fix: pylint fixes --- eox_hooks/tests/test_integration.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/eox_hooks/tests/test_integration.py b/eox_hooks/tests/test_integration.py index 5b850df..0200249 100644 --- a/eox_hooks/tests/test_integration.py +++ b/eox_hooks/tests/test_integration.py @@ -23,18 +23,19 @@ def test_current_settings_code_imports(self): Running this imports means that our backends import the right signature """ import eox_hooks.edxapp_wrapper.backends.course_modes_j_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.course_modes_l_v1_test # isort:skip - import eox_hooks.edxapp_wrapper.backends.course_modes_l_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.courses_j_v1_test # isort:skip - import eox_hooks.edxapp_wrapper.backends.courses_j_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.courses_l_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.courses_p_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.enrollments_l_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.enrollments_l_v1_test # isort:skip - import eox_hooks.edxapp_wrapper.backends.enrollments_j_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.models_j_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.models_l_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.models_l_v1_test # isort:skip + import eox_hooks.edxapp_wrapper.backends.course_modes_l_v1_test # isort:skip + import eox_hooks.edxapp_wrapper.backends.course_modes_l_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.courses_j_v1_test # isort:skip + import eox_hooks.edxapp_wrapper.backends.courses_j_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.courses_l_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.courses_p_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.enrollments_l_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.enrollments_l_v1_test # isort:skip + import eox_hooks.edxapp_wrapper.backends.enrollments_j_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.models_j_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.models_l_v1 # isort:skip + import eox_hooks.edxapp_wrapper.backends.models_l_v1_test # isort:skip + class TestPostToWebhook(TestCase): @patch('eox_hooks.actions.requests.post') # Mock de la función requests.post From 26064b9a0d733ddb315d50b4f96633ddc6494cf6 Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Mon, 6 May 2024 16:07:03 -0500 Subject: [PATCH 05/31] fix: pylint fixes --- eox_hooks/tests/test_integration.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/eox_hooks/tests/test_integration.py b/eox_hooks/tests/test_integration.py index 0200249..5be8e44 100644 --- a/eox_hooks/tests/test_integration.py +++ b/eox_hooks/tests/test_integration.py @@ -1,8 +1,8 @@ """ Test views file. """ -from django.test import TestCase from unittest.mock import patch, MagicMock +from django.test import TestCase from eox_hooks.actions import post_to_webhook_url @@ -38,11 +38,17 @@ def test_current_settings_code_imports(self): class TestPostToWebhook(TestCase): - @patch('eox_hooks.actions.requests.post') # Mock de la función requests.post + """ + Test eox-hooks functions + """ + @patch('eox_hooks.actions.requests.post') def test_post_to_webhook_url(self, mock_post): + """ + Test function post_to_webhook_url + """ mock_trigger_event = "trigger_event" - mock_post.return_value = MagicMock(status_code=200) # Simula una respuesta exitosa + mock_post.return_value = MagicMock(status_code=200) result = post_to_webhook_url(trigger_event=mock_trigger_event) From 942cdebdcb880219cf81e898634538417c1bc8b3 Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Mon, 6 May 2024 16:11:09 -0500 Subject: [PATCH 06/31] fix: pylint fixes --- eox_hooks/tests/test_integration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eox_hooks/tests/test_integration.py b/eox_hooks/tests/test_integration.py index 5be8e44..1ebba45 100644 --- a/eox_hooks/tests/test_integration.py +++ b/eox_hooks/tests/test_integration.py @@ -1,7 +1,7 @@ """ Test views file. """ -from unittest.mock import patch, MagicMock +from unittest.mock import MagicMock, patch from django.test import TestCase from eox_hooks.actions import post_to_webhook_url From b2c64061ce082ac0a0f5a4fb217fd14026ef80f8 Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Mon, 6 May 2024 16:13:42 -0500 Subject: [PATCH 07/31] fix: pylint fixes --- eox_hooks/tests/test_integration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eox_hooks/tests/test_integration.py b/eox_hooks/tests/test_integration.py index 1ebba45..0a6b5c3 100644 --- a/eox_hooks/tests/test_integration.py +++ b/eox_hooks/tests/test_integration.py @@ -1,8 +1,8 @@ """ Test views file. """ -from unittest.mock import MagicMock, patch from django.test import TestCase +from unittest.mock import MagicMock, patch from eox_hooks.actions import post_to_webhook_url From e362813dd3da44c5f812f1f178ec6f1fa119eb9a Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Mon, 6 May 2024 16:15:54 -0500 Subject: [PATCH 08/31] fix: pylint fixes --- eox_hooks/tests/test_integration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eox_hooks/tests/test_integration.py b/eox_hooks/tests/test_integration.py index 0a6b5c3..1ebba45 100644 --- a/eox_hooks/tests/test_integration.py +++ b/eox_hooks/tests/test_integration.py @@ -1,8 +1,8 @@ """ Test views file. """ -from django.test import TestCase from unittest.mock import MagicMock, patch +from django.test import TestCase from eox_hooks.actions import post_to_webhook_url From bd88077a540cbe7f8c2c3c6cd48cf7cfedd9d0e1 Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Mon, 6 May 2024 16:16:44 -0500 Subject: [PATCH 09/31] fix: pylint fixes --- eox_hooks/tests/test_integration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eox_hooks/tests/test_integration.py b/eox_hooks/tests/test_integration.py index 1ebba45..829304a 100644 --- a/eox_hooks/tests/test_integration.py +++ b/eox_hooks/tests/test_integration.py @@ -1,5 +1,5 @@ """ -Test views file. +Test integration file. """ from unittest.mock import MagicMock, patch from django.test import TestCase From 1cb714761bb8f77ba8506f4b90950a48a65a4100 Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Mon, 6 May 2024 16:21:12 -0500 Subject: [PATCH 10/31] fix: pylint fixes --- eox_hooks/tests/test_integration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eox_hooks/tests/test_integration.py b/eox_hooks/tests/test_integration.py index 829304a..cdc876f 100644 --- a/eox_hooks/tests/test_integration.py +++ b/eox_hooks/tests/test_integration.py @@ -2,8 +2,8 @@ Test integration file. """ from unittest.mock import MagicMock, patch -from django.test import TestCase from eox_hooks.actions import post_to_webhook_url +from django.test import TestCase class TutorIntegrationTestCase(TestCase): From dfa5879f66b65ed5372c2d7f78e31980ce70a68f Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Mon, 6 May 2024 16:23:50 -0500 Subject: [PATCH 11/31] fix: pylint fixes --- eox_hooks/tests/test_integration.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eox_hooks/tests/test_integration.py b/eox_hooks/tests/test_integration.py index cdc876f..7153488 100644 --- a/eox_hooks/tests/test_integration.py +++ b/eox_hooks/tests/test_integration.py @@ -1,9 +1,9 @@ """ Test integration file. """ -from unittest.mock import MagicMock, patch -from eox_hooks.actions import post_to_webhook_url +from unittest.mock import MagicMock, patch # pylint: disable=C0411 from django.test import TestCase +from eox_hooks.actions import post_to_webhook_url class TutorIntegrationTestCase(TestCase): From 2af8ea08606e74a4a34898c065ad5af6af0c8ab4 Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Mon, 6 May 2024 16:25:55 -0500 Subject: [PATCH 12/31] fix: pylint fixes --- eox_hooks/tests/test_integration.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eox_hooks/tests/test_integration.py b/eox_hooks/tests/test_integration.py index 7153488..5d48cef 100644 --- a/eox_hooks/tests/test_integration.py +++ b/eox_hooks/tests/test_integration.py @@ -2,7 +2,9 @@ Test integration file. """ from unittest.mock import MagicMock, patch # pylint: disable=C0411 + from django.test import TestCase + from eox_hooks.actions import post_to_webhook_url From 61d983712cee341cec6aff9438bbe3e0833e8dc1 Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Wed, 8 May 2024 16:52:30 -0500 Subject: [PATCH 13/31] fix: remove unused function to test integration --- .../backends/course_modes_j_v1.py | 2 +- .../backends/course_modes_l_v1.py | 2 +- .../edxapp_wrapper/backends/courses_j_v1.py | 2 +- .../edxapp_wrapper/backends/courses_l_v1.py | 4 +-- .../edxapp_wrapper/backends/courses_p_v1.py | 5 ++-- .../backends/enrollments_j_v1.py | 3 +- .../backends/enrollments_l_v1.py | 3 +- .../edxapp_wrapper/backends/models_j_v1.py | 4 +-- .../edxapp_wrapper/backends/models_l_v1.py | 4 +-- eox_hooks/tests/test_integration.py | 30 +------------------ 10 files changed, 17 insertions(+), 42 deletions(-) diff --git a/eox_hooks/edxapp_wrapper/backends/course_modes_j_v1.py b/eox_hooks/edxapp_wrapper/backends/course_modes_j_v1.py index a8e93ab..59a0f50 100644 --- a/eox_hooks/edxapp_wrapper/backends/course_modes_j_v1.py +++ b/eox_hooks/edxapp_wrapper/backends/course_modes_j_v1.py @@ -1,6 +1,7 @@ """ Backend file for Course Modes related objects. """ +from course_modes.models import CourseMode # pylint: disable=C0415, E0401 def get_all_course_modes(): @@ -10,6 +11,5 @@ def get_all_course_modes(): Returns: [list]: list of course modes. """ - from course_modes.models import CourseMode # pylint: disable=C0415, E0401 modes_for_course = CourseMode.ALL_MODES return modes_for_course diff --git a/eox_hooks/edxapp_wrapper/backends/course_modes_l_v1.py b/eox_hooks/edxapp_wrapper/backends/course_modes_l_v1.py index aff2aee..43caabf 100644 --- a/eox_hooks/edxapp_wrapper/backends/course_modes_l_v1.py +++ b/eox_hooks/edxapp_wrapper/backends/course_modes_l_v1.py @@ -1,6 +1,7 @@ """ Backend file for Course Modes related objects. """ +from common.djangoapps.course_modes.models import CourseMode # pylint: disable=C0415, E0401 def get_all_course_modes(): @@ -10,6 +11,5 @@ def get_all_course_modes(): Returns: [list]: list of course modes. """ - from common.djangoapps.course_modes.models import CourseMode # pylint: disable=C0415, E0401 modes_for_course = CourseMode.ALL_MODES return modes_for_course diff --git a/eox_hooks/edxapp_wrapper/backends/courses_j_v1.py b/eox_hooks/edxapp_wrapper/backends/courses_j_v1.py index a3d6ae2..d809891 100644 --- a/eox_hooks/edxapp_wrapper/backends/courses_j_v1.py +++ b/eox_hooks/edxapp_wrapper/backends/courses_j_v1.py @@ -1,6 +1,7 @@ """ Backend file for Course related objects. """ +from courseware.module_render import load_single_xblock # pylint: disable=C0415, E0401 def get_load_single_xblock(): @@ -10,7 +11,6 @@ def get_load_single_xblock(): Returns: [Function]: load_single_xblock function. """ - from courseware.module_render import load_single_xblock # pylint: disable=C0415, E0401 return load_single_xblock diff --git a/eox_hooks/edxapp_wrapper/backends/courses_l_v1.py b/eox_hooks/edxapp_wrapper/backends/courses_l_v1.py index bff3b7f..2b51760 100644 --- a/eox_hooks/edxapp_wrapper/backends/courses_l_v1.py +++ b/eox_hooks/edxapp_wrapper/backends/courses_l_v1.py @@ -1,6 +1,8 @@ """ Backend file for Course related objects. """ +from lms.djangoapps.courseware.module_render import load_single_xblock # pylint: disable=C0415, E0401 +from xmodule.modulestore.exceptions import ItemNotFoundError # pylint: disable=C0415, E0401 def get_load_single_xblock(): @@ -10,7 +12,6 @@ def get_load_single_xblock(): Returns: [Function]: load_single_xblock function. """ - from lms.djangoapps.courseware.module_render import load_single_xblock # pylint: disable=C0415, E0401 return load_single_xblock @@ -21,5 +22,4 @@ def get_item_not_found_exception(): Returns: [Class]: ItemNotFoundError exception. """ - from xmodule.modulestore.exceptions import ItemNotFoundError # pylint: disable=C0415, E0401 return ItemNotFoundError diff --git a/eox_hooks/edxapp_wrapper/backends/courses_p_v1.py b/eox_hooks/edxapp_wrapper/backends/courses_p_v1.py index 24184bc..67549d6 100644 --- a/eox_hooks/edxapp_wrapper/backends/courses_p_v1.py +++ b/eox_hooks/edxapp_wrapper/backends/courses_p_v1.py @@ -1,6 +1,9 @@ """ Backend file for Course related objects. """ +from lms.djangoapps.courseware.block_render import load_single_xblock # pylint: disable=C0415, E0401 +from xmodule.modulestore.exceptions import ItemNotFoundError # pylint: disable=C0415, E0401 + def get_load_single_xblock(): @@ -10,7 +13,6 @@ def get_load_single_xblock(): Returns: [Function]: load_single_xblock function. """ - from lms.djangoapps.courseware.block_render import load_single_xblock # pylint: disable=C0415, E0401 return load_single_xblock @@ -21,5 +23,4 @@ def get_item_not_found_exception(): Returns: [Class]: ItemNotFoundError exception. """ - from xmodule.modulestore.exceptions import ItemNotFoundError # pylint: disable=C0415, E0401 return ItemNotFoundError diff --git a/eox_hooks/edxapp_wrapper/backends/enrollments_j_v1.py b/eox_hooks/edxapp_wrapper/backends/enrollments_j_v1.py index 4210249..19b7a33 100644 --- a/eox_hooks/edxapp_wrapper/backends/enrollments_j_v1.py +++ b/eox_hooks/edxapp_wrapper/backends/enrollments_j_v1.py @@ -1,6 +1,8 @@ """ Backend file for Course Enrollment related objects. """ +from student.models import CourseEnrollment # pylint: disable=C0415, E0401 + def get_course_enrollment(): @@ -10,5 +12,4 @@ def get_course_enrollment(): Returns: [Class]: Course Enrollment edxapp model. """ - from student.models import CourseEnrollment # pylint: disable=C0415, E0401 return CourseEnrollment diff --git a/eox_hooks/edxapp_wrapper/backends/enrollments_l_v1.py b/eox_hooks/edxapp_wrapper/backends/enrollments_l_v1.py index f2160ec..2b28838 100644 --- a/eox_hooks/edxapp_wrapper/backends/enrollments_l_v1.py +++ b/eox_hooks/edxapp_wrapper/backends/enrollments_l_v1.py @@ -1,6 +1,8 @@ """ Backend file for Course Enrollment related objects. """ +from common.djangoapps.student.models import CourseEnrollment # pylint: disable=C0415, E0401 + def get_course_enrollment(): @@ -10,5 +12,4 @@ def get_course_enrollment(): Returns: [Class]: Course Enrollment edxapp model. """ - from common.djangoapps.student.models import CourseEnrollment # pylint: disable=C0415, E0401 return CourseEnrollment diff --git a/eox_hooks/edxapp_wrapper/backends/models_j_v1.py b/eox_hooks/edxapp_wrapper/backends/models_j_v1.py index e02f331..0aedcac 100644 --- a/eox_hooks/edxapp_wrapper/backends/models_j_v1.py +++ b/eox_hooks/edxapp_wrapper/backends/models_j_v1.py @@ -1,15 +1,15 @@ """ Simple backend that returns the platform's models """ +from lms.djangoapps.certificates.models import GeneratedCertificate # pylint: disable=C0415, E0401 +from student.models import UserProfile # pylint: disable=C0415, E0401 def get_certificate_model(): """Return the GeneratedCertificate model class when called during runtime""" - from lms.djangoapps.certificates.models import GeneratedCertificate # pylint: disable=C0415, E0401 return GeneratedCertificate def get_user_profile_model(): """Return the UserProfile model class when called during runtime""" - from student.models import UserProfile # pylint: disable=C0415, E0401 return UserProfile diff --git a/eox_hooks/edxapp_wrapper/backends/models_l_v1.py b/eox_hooks/edxapp_wrapper/backends/models_l_v1.py index fdb0ab8..99b7417 100644 --- a/eox_hooks/edxapp_wrapper/backends/models_l_v1.py +++ b/eox_hooks/edxapp_wrapper/backends/models_l_v1.py @@ -1,15 +1,15 @@ """ Simple backend that returns the platform's models """ +from lms.djangoapps.certificates.models import GeneratedCertificate # pylint: disable=C0415, E0401 +from common.djangoapps.student.models import UserProfile # pylint: disable=C0415, E0401 def get_certificate_model(): """Return the GeneratedCertificate model class when called during runtime""" - from lms.djangoapps.certificates.models import GeneratedCertificate # pylint: disable=C0415, E0401 return GeneratedCertificate def get_user_profile_model(): """Return the UserProfile model class when called during runtime""" - from common.djangoapps.student.models import UserProfile # pylint: disable=C0415, E0401 return UserProfile diff --git a/eox_hooks/tests/test_integration.py b/eox_hooks/tests/test_integration.py index 5d48cef..b7130aa 100644 --- a/eox_hooks/tests/test_integration.py +++ b/eox_hooks/tests/test_integration.py @@ -5,19 +5,12 @@ from django.test import TestCase -from eox_hooks.actions import post_to_webhook_url - class TutorIntegrationTestCase(TestCase): """ - POC code to run tests that cover the integration with openedx + Tests integration with openedx """ - def test_runs_code(self): - """ - Just to make sure our test infrastructure is behaving - """ - assert True # pylint: disable=import-outside-toplevel,unused-import def test_current_settings_code_imports(self): @@ -25,33 +18,12 @@ def test_current_settings_code_imports(self): Running this imports means that our backends import the right signature """ import eox_hooks.edxapp_wrapper.backends.course_modes_j_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.course_modes_l_v1_test # isort:skip import eox_hooks.edxapp_wrapper.backends.course_modes_l_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.courses_j_v1_test # isort:skip import eox_hooks.edxapp_wrapper.backends.courses_j_v1 # isort:skip import eox_hooks.edxapp_wrapper.backends.courses_l_v1 # isort:skip import eox_hooks.edxapp_wrapper.backends.courses_p_v1 # isort:skip import eox_hooks.edxapp_wrapper.backends.enrollments_l_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.enrollments_l_v1_test # isort:skip import eox_hooks.edxapp_wrapper.backends.enrollments_j_v1 # isort:skip import eox_hooks.edxapp_wrapper.backends.models_j_v1 # isort:skip import eox_hooks.edxapp_wrapper.backends.models_l_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.models_l_v1_test # isort:skip - - -class TestPostToWebhook(TestCase): - """ - Test eox-hooks functions - """ - @patch('eox_hooks.actions.requests.post') - def test_post_to_webhook_url(self, mock_post): - """ - Test function post_to_webhook_url - """ - mock_trigger_event = "trigger_event" - - mock_post.return_value = MagicMock(status_code=200) - - result = post_to_webhook_url(trigger_event=mock_trigger_event) - self.assertTrue(result) From e0fcf09b06ec10d380b904692cae771ac6eed2b8 Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Wed, 8 May 2024 17:01:55 -0500 Subject: [PATCH 14/31] fix: pylint fixes --- eox_hooks/tests/test_integration.py | 1 - 1 file changed, 1 deletion(-) diff --git a/eox_hooks/tests/test_integration.py b/eox_hooks/tests/test_integration.py index b7130aa..15b4bff 100644 --- a/eox_hooks/tests/test_integration.py +++ b/eox_hooks/tests/test_integration.py @@ -26,4 +26,3 @@ def test_current_settings_code_imports(self): import eox_hooks.edxapp_wrapper.backends.enrollments_j_v1 # isort:skip import eox_hooks.edxapp_wrapper.backends.models_j_v1 # isort:skip import eox_hooks.edxapp_wrapper.backends.models_l_v1 # isort:skip - From b9b7501f065772ee7e1b9f4a3ec386eb3435fac5 Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Fri, 10 May 2024 14:19:56 -0500 Subject: [PATCH 15/31] fix: ignore pylint integration file --- .../tests/{test_integration.py => integration_test.py} | 10 +--------- setup.cfg | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) rename eox_hooks/tests/{test_integration.py => integration_test.py} (56%) diff --git a/eox_hooks/tests/test_integration.py b/eox_hooks/tests/integration_test.py similarity index 56% rename from eox_hooks/tests/test_integration.py rename to eox_hooks/tests/integration_test.py index 15b4bff..ad5e6f7 100644 --- a/eox_hooks/tests/test_integration.py +++ b/eox_hooks/tests/integration_test.py @@ -1,28 +1,20 @@ """ Test integration file. """ -from unittest.mock import MagicMock, patch # pylint: disable=C0411 - from django.test import TestCase -class TutorIntegrationTestCase(TestCase): +class IntegrationTestCase(TestCase): """ Tests integration with openedx """ - # pylint: disable=import-outside-toplevel,unused-import def test_current_settings_code_imports(self): """ Running this imports means that our backends import the right signature """ - import eox_hooks.edxapp_wrapper.backends.course_modes_j_v1 # isort:skip import eox_hooks.edxapp_wrapper.backends.course_modes_l_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.courses_j_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.courses_l_v1 # isort:skip import eox_hooks.edxapp_wrapper.backends.courses_p_v1 # isort:skip import eox_hooks.edxapp_wrapper.backends.enrollments_l_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.enrollments_j_v1 # isort:skip - import eox_hooks.edxapp_wrapper.backends.models_j_v1 # isort:skip import eox_hooks.edxapp_wrapper.backends.models_l_v1 # isort:skip diff --git a/setup.cfg b/setup.cfg index 2b8d907..308d812 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,7 +16,7 @@ max-line-length = 120 statistics = True [pylint] -ignore = CVS +ignore = CVS, eox_hooks/tests/integration_test.py [MESSAGES CONTROL] enable = From a3e7f4b0b3e1efe3e589053f63ed58a5bf85441a Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Fri, 10 May 2024 15:08:30 -0500 Subject: [PATCH 16/31] fix: pylint fixes --- eox_hooks/edxapp_wrapper/backends/courses_p_v1.py | 1 - eox_hooks/edxapp_wrapper/backends/enrollments_j_v1.py | 1 - eox_hooks/edxapp_wrapper/backends/enrollments_l_v1.py | 1 - 3 files changed, 3 deletions(-) diff --git a/eox_hooks/edxapp_wrapper/backends/courses_p_v1.py b/eox_hooks/edxapp_wrapper/backends/courses_p_v1.py index 67549d6..0a68ac2 100644 --- a/eox_hooks/edxapp_wrapper/backends/courses_p_v1.py +++ b/eox_hooks/edxapp_wrapper/backends/courses_p_v1.py @@ -5,7 +5,6 @@ from xmodule.modulestore.exceptions import ItemNotFoundError # pylint: disable=C0415, E0401 - def get_load_single_xblock(): """ Gets load_single_xblock function from edxapp. diff --git a/eox_hooks/edxapp_wrapper/backends/enrollments_j_v1.py b/eox_hooks/edxapp_wrapper/backends/enrollments_j_v1.py index 19b7a33..bc01b7c 100644 --- a/eox_hooks/edxapp_wrapper/backends/enrollments_j_v1.py +++ b/eox_hooks/edxapp_wrapper/backends/enrollments_j_v1.py @@ -4,7 +4,6 @@ from student.models import CourseEnrollment # pylint: disable=C0415, E0401 - def get_course_enrollment(): """ Gets Course Enrollment class model from edxapp. diff --git a/eox_hooks/edxapp_wrapper/backends/enrollments_l_v1.py b/eox_hooks/edxapp_wrapper/backends/enrollments_l_v1.py index 2b28838..6a16a03 100644 --- a/eox_hooks/edxapp_wrapper/backends/enrollments_l_v1.py +++ b/eox_hooks/edxapp_wrapper/backends/enrollments_l_v1.py @@ -4,7 +4,6 @@ from common.djangoapps.student.models import CourseEnrollment # pylint: disable=C0415, E0401 - def get_course_enrollment(): """ Gets Course Enrollment class model from edxapp. From 1a8ee1f35ff023bb533217cf73f07dd183830b35 Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Fri, 10 May 2024 15:18:54 -0500 Subject: [PATCH 17/31] fix: pylint fixes --- eox_hooks/edxapp_wrapper/backends/models_l_v1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eox_hooks/edxapp_wrapper/backends/models_l_v1.py b/eox_hooks/edxapp_wrapper/backends/models_l_v1.py index 99b7417..1f502bd 100644 --- a/eox_hooks/edxapp_wrapper/backends/models_l_v1.py +++ b/eox_hooks/edxapp_wrapper/backends/models_l_v1.py @@ -1,8 +1,8 @@ """ Simple backend that returns the platform's models """ -from lms.djangoapps.certificates.models import GeneratedCertificate # pylint: disable=C0415, E0401 from common.djangoapps.student.models import UserProfile # pylint: disable=C0415, E0401 +from lms.djangoapps.certificates.models import GeneratedCertificate # pylint: disable=C0415, E0401 def get_certificate_model(): From 34c0610655fff9ad67e311bb06d3e61dd97fb5be Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Fri, 10 May 2024 15:47:37 -0500 Subject: [PATCH 18/31] fix: ignore pylint integration file --- eox_hooks/tests/{integration_test.py => test_integration.py} | 0 setup.cfg | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename eox_hooks/tests/{integration_test.py => test_integration.py} (100%) diff --git a/eox_hooks/tests/integration_test.py b/eox_hooks/tests/test_integration.py similarity index 100% rename from eox_hooks/tests/integration_test.py rename to eox_hooks/tests/test_integration.py diff --git a/setup.cfg b/setup.cfg index 308d812..140e2ac 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,7 +16,7 @@ max-line-length = 120 statistics = True [pylint] -ignore = CVS, eox_hooks/tests/integration_test.py +ignore = CVS, eox_hooks/tests/test_integration.py [MESSAGES CONTROL] enable = From 416b74e72876fdd4bab57cfb851a42c2c965114e Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Fri, 10 May 2024 15:52:27 -0500 Subject: [PATCH 19/31] fix: ignore pylint integration file --- setup.cfg | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 140e2ac..c92494e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,7 +16,10 @@ max-line-length = 120 statistics = True [pylint] -ignore = CVS, eox_hooks/tests/test_integration.py +ignore = CVS + +[pylint.'test_integration.py'] +ignore = yes [MESSAGES CONTROL] enable = From e77ca5a2eea0ee3aa28c61f24413cce19f19867d Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Fri, 10 May 2024 15:58:44 -0500 Subject: [PATCH 20/31] fix: ignore pylint integration file --- eox_hooks/tests/test_integration.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eox_hooks/tests/test_integration.py b/eox_hooks/tests/test_integration.py index ad5e6f7..3e7ce43 100644 --- a/eox_hooks/tests/test_integration.py +++ b/eox_hooks/tests/test_integration.py @@ -2,8 +2,10 @@ Test integration file. """ from django.test import TestCase +import unittest +@unittest.skip("Disabled") class IntegrationTestCase(TestCase): """ Tests integration with openedx From e6da3019e734f591eadb0fe577f98b6f0cfaa376 Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Fri, 10 May 2024 16:00:25 -0500 Subject: [PATCH 21/31] fix: ignore pylint integration file --- eox_hooks/tests/test_integration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eox_hooks/tests/test_integration.py b/eox_hooks/tests/test_integration.py index 3e7ce43..a08b983 100644 --- a/eox_hooks/tests/test_integration.py +++ b/eox_hooks/tests/test_integration.py @@ -1,8 +1,8 @@ """ Test integration file. """ -from django.test import TestCase import unittest +from django.test import TestCase @unittest.skip("Disabled") From 46199e684d3bbf0d100d7e7d1c7b23a5de8b8103 Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Fri, 10 May 2024 16:01:56 -0500 Subject: [PATCH 22/31] fix: ignore pylint integration file --- eox_hooks/tests/test_integration.py | 1 + 1 file changed, 1 insertion(+) diff --git a/eox_hooks/tests/test_integration.py b/eox_hooks/tests/test_integration.py index a08b983..8227663 100644 --- a/eox_hooks/tests/test_integration.py +++ b/eox_hooks/tests/test_integration.py @@ -2,6 +2,7 @@ Test integration file. """ import unittest + from django.test import TestCase From ca7f08ed90980bbbf3f6b35a8c9fdac7837b4573 Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Thu, 16 May 2024 02:59:02 -0500 Subject: [PATCH 23/31] fix: refactor integration test --- eox_hooks/settings/test.py | 12 ++++++++++++ eox_hooks/tests/tutor/__init__.py | 0 eox_hooks/tests/tutor/conftest.py | 16 ++++++++++++++++ .../integration_test_tutor.py} | 5 +---- eox_hooks/tests/tutor/pytest.ini | 7 +++++++ 5 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 eox_hooks/tests/tutor/__init__.py create mode 100644 eox_hooks/tests/tutor/conftest.py rename eox_hooks/tests/{test_integration.py => tutor/integration_test_tutor.py} (88%) create mode 100644 eox_hooks/tests/tutor/pytest.ini diff --git a/eox_hooks/settings/test.py b/eox_hooks/settings/test.py index 81dd7e1..d12ff1e 100644 --- a/eox_hooks/settings/test.py +++ b/eox_hooks/settings/test.py @@ -1,7 +1,10 @@ """ Test Django settings for eox_hooks project. """ +import codecs +import os +import yaml from .common import * # pylint: disable=wildcard-import, unused-wildcard-import @@ -43,3 +46,12 @@ 'NAME': 'db.sqlite3', } } + +def plugin_settings(settings): # pylint: disable=function-redefined + """ + For the platform tests + """ + # setup the databases used in the tutor local environment + with codecs.open(os.environ['LMS_CFG'], encoding='utf-8') as f: + env_tokens = yaml.safe_load(f) + settings.DATABASES = env_tokens['DATABASES'] diff --git a/eox_hooks/tests/tutor/__init__.py b/eox_hooks/tests/tutor/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/eox_hooks/tests/tutor/conftest.py b/eox_hooks/tests/tutor/conftest.py new file mode 100644 index 0000000..cf72ca9 --- /dev/null +++ b/eox_hooks/tests/tutor/conftest.py @@ -0,0 +1,16 @@ +""" +The conftest module sets up the database connection for pytest-django. + +The integration tests will reuse the database from tutor local so a noop +django_db_setup is required. +See: https://pytest-django.readthedocs.io/en/latest/database.html +""" + +import pytest # pylint: disable=import-error + + +@pytest.fixture(scope='session') +def django_db_setup(): + """ + Makes the tests reuse the existing database + """ diff --git a/eox_hooks/tests/test_integration.py b/eox_hooks/tests/tutor/integration_test_tutor.py similarity index 88% rename from eox_hooks/tests/test_integration.py rename to eox_hooks/tests/tutor/integration_test_tutor.py index 8227663..3cf8db6 100644 --- a/eox_hooks/tests/test_integration.py +++ b/eox_hooks/tests/tutor/integration_test_tutor.py @@ -1,13 +1,10 @@ """ Test integration file. """ -import unittest - from django.test import TestCase -@unittest.skip("Disabled") -class IntegrationTestCase(TestCase): +class TutorIntegrationTestCase(TestCase): """ Tests integration with openedx """ diff --git a/eox_hooks/tests/tutor/pytest.ini b/eox_hooks/tests/tutor/pytest.ini new file mode 100644 index 0000000..f3b7462 --- /dev/null +++ b/eox_hooks/tests/tutor/pytest.ini @@ -0,0 +1,7 @@ +[pytest] +python_files = integration_test_*.py +filterwarnings = + default + # We ignore every warning while we actually get the testing infrastructure + # running for different version of tutor in gh actions + ignore: From 29d4be74abb18a9d77b42bf1877fc36b60d000bc Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Thu, 16 May 2024 03:03:20 -0500 Subject: [PATCH 24/31] fix: refactor integration test --- requirements/test.in | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/test.in b/requirements/test.in index 1d18bc3..8a1cbe3 100644 --- a/requirements/test.in +++ b/requirements/test.in @@ -7,3 +7,4 @@ coverage mock testfixtures requests +pyyaml From fe9e205496127794f617ebbaa1f4c86bd4952237 Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Thu, 16 May 2024 03:07:10 -0500 Subject: [PATCH 25/31] fix: refactor integration test --- requirements/test.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/requirements/test.txt b/requirements/test.txt index 0a52ba8..639c419 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -113,6 +113,8 @@ pymongo==3.13.0 # via # -r requirements/base.txt # edx-opaque-keys +pyyaml==6.0.1 + # via -r requirements/test.in python-dateutil==2.8.2 # via # -r requirements/base.txt From 64112a8401c3b073978c723a4607faee074536b9 Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Thu, 16 May 2024 03:09:14 -0500 Subject: [PATCH 26/31] fix: pylint error --- eox_hooks/settings/test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/eox_hooks/settings/test.py b/eox_hooks/settings/test.py index d12ff1e..1ee4e91 100644 --- a/eox_hooks/settings/test.py +++ b/eox_hooks/settings/test.py @@ -47,6 +47,7 @@ } } + def plugin_settings(settings): # pylint: disable=function-redefined """ For the platform tests From f262f4a317233ce8a8dcf831046bb5f2226221da Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Thu, 16 May 2024 03:42:07 -0500 Subject: [PATCH 27/31] fix: remove pylint ignore --- setup.cfg | 3 --- 1 file changed, 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index c92494e..2b8d907 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,9 +18,6 @@ statistics = True [pylint] ignore = CVS -[pylint.'test_integration.py'] -ignore = yes - [MESSAGES CONTROL] enable = line-too-long, From 9ca84bcfde17da67448b3d6f9d0381810455a231 Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Tue, 21 May 2024 10:46:41 -0500 Subject: [PATCH 28/31] fix: comment test settings --- eox_hooks/settings/test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eox_hooks/settings/test.py b/eox_hooks/settings/test.py index 1ee4e91..b01c4b6 100644 --- a/eox_hooks/settings/test.py +++ b/eox_hooks/settings/test.py @@ -53,6 +53,6 @@ def plugin_settings(settings): # pylint: disable=function-redefined For the platform tests """ # setup the databases used in the tutor local environment - with codecs.open(os.environ['LMS_CFG'], encoding='utf-8') as f: - env_tokens = yaml.safe_load(f) - settings.DATABASES = env_tokens['DATABASES'] + # with codecs.open(os.environ['LMS_CFG'], encoding='utf-8') as f: + # env_tokens = yaml.safe_load(f) + # settings.DATABASES = env_tokens['DATABASES'] From 3f5ed15c6624dee2542153c6b0b1a84be866c59e Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Tue, 21 May 2024 10:59:11 -0500 Subject: [PATCH 29/31] fix: comment test settings --- eox_hooks/settings/test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eox_hooks/settings/test.py b/eox_hooks/settings/test.py index b01c4b6..f97e729 100644 --- a/eox_hooks/settings/test.py +++ b/eox_hooks/settings/test.py @@ -48,10 +48,10 @@ } -def plugin_settings(settings): # pylint: disable=function-redefined - """ - For the platform tests - """ +# def plugin_settings(settings): # pylint: disable=function-redefined +# """ +# For the platform tests +# """ # setup the databases used in the tutor local environment # with codecs.open(os.environ['LMS_CFG'], encoding='utf-8') as f: # env_tokens = yaml.safe_load(f) From b9caf05c039954b51b05ddba007edaa8daab3798 Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Tue, 21 May 2024 11:00:47 -0500 Subject: [PATCH 30/31] fix: comment test settings --- eox_hooks/settings/test.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/eox_hooks/settings/test.py b/eox_hooks/settings/test.py index f97e729..a8059ae 100644 --- a/eox_hooks/settings/test.py +++ b/eox_hooks/settings/test.py @@ -46,13 +46,3 @@ 'NAME': 'db.sqlite3', } } - - -# def plugin_settings(settings): # pylint: disable=function-redefined -# """ -# For the platform tests -# """ - # setup the databases used in the tutor local environment - # with codecs.open(os.environ['LMS_CFG'], encoding='utf-8') as f: - # env_tokens = yaml.safe_load(f) - # settings.DATABASES = env_tokens['DATABASES'] From 1958c2b7466b84a1a609bd71544935b7e96daeab Mon Sep 17 00:00:00 2001 From: Luis Felipe Castano Date: Tue, 21 May 2024 11:12:11 -0500 Subject: [PATCH 31/31] fix: comment test settings --- eox_hooks/settings/test.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/eox_hooks/settings/test.py b/eox_hooks/settings/test.py index a8059ae..cf6c317 100644 --- a/eox_hooks/settings/test.py +++ b/eox_hooks/settings/test.py @@ -46,3 +46,14 @@ 'NAME': 'db.sqlite3', } } + + +def plugin_settings(settings): # pylint: disable=function-redefined + """ + For the platform tests + """ + # setup the databases used in the tutor local environment + if os.environ['LMS_CFG']: + with codecs.open(os.environ['LMS_CFG'], encoding='utf-8') as f: + env_tokens = yaml.safe_load(f) + settings.DATABASES = env_tokens['DATABASES']