Skip to content

Commit

Permalink
feat: add api integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
luisfelipec95 committed Jun 21, 2024
1 parent 4181cf0 commit c1dfe41
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion eox_tagging/test/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=['local.edly.io', '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 @@ -17,3 +24,21 @@ def test_current_settings_code_imports(self):
import eox_tagging.edxapp_wrappers.backends.course_overview_i_v1 # isort:skip
import eox_tagging.edxapp_wrappers.backends.bearer_authentication_i_v1 # isort:skip
import eox_tagging.edxapp_wrappers.backends.enrollment_l_v1 # isort:skip

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

# Simulate a GET request to the info endpoint using the full URL
response = self.client.get(info_view_url)

# Verify the response status code
self.assertEqual(response.status_code, 200)

# Verify the response format
response_data = response.json()
self.assertIn('version', response_data)
self.assertIn('name', response_data)
self.assertIn('git', response_data)

0 comments on commit c1dfe41

Please sign in to comment.