Skip to content

Commit

Permalink
feat: add api integration test (#272)
Browse files Browse the repository at this point in the history
* feat: add api integration test

* fix: quality changes
  • Loading branch information
luisfelipec95 committed Jun 25, 2024
1 parent b1bc595 commit 1176b68
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion eox_core/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 @@ -24,3 +31,18 @@ def test_current_settings_code_imports(self):
import eox_core.edxapp_wrapper.backends.pre_enrollment_l_v1 # isort:skip
import eox_core.edxapp_wrapper.backends.storages_i_v1 # isort:skip
import eox_core.edxapp_wrapper.backends.third_party_auth_l_v1 # isort:skip

def test_info_view(self):
"""
Tests the info view endpoint in Tutor
"""
info_view_url = f'{self.base_url}/eox-core/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)

0 comments on commit 1176b68

Please sign in to comment.