Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add api test #53

Merged
merged 9 commits into from
Jun 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion eox_hooks/tests/tutor/integration_test_tutor.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
"""
Test integration file.
"""
from django.test import TestCase
from django.test import TestCase, override_settings


@override_settings(ALLOWED_HOSTS=['testserver'], SITE_ID=2)
class TutorIntegrationTestCase(TestCase):
"""
Tests integration with openedx
"""

def setUp(self):
"""
Set up the base URL for the tests
"""
self.base_url = 'http://local.edly.io'

# pylint: disable=import-outside-toplevel,unused-import
def test_current_settings_code_imports(self):
"""
Expand All @@ -18,3 +25,18 @@ def test_current_settings_code_imports(self):
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.models_l_v1 # isort:skip

def test_info_view(self):
"""
Tests the info view endpoint in Tutor
"""
info_view_url = f'{self.base_url}/eox-hooks/eox-info'

response = self.client.get(info_view_url)

self.assertEqual(response.status_code, 200)

response_data = response.json()
self.assertIn('version', response_data)
self.assertIn('name', response_data)
self.assertIn('git', response_data)
Loading