Skip to content

Commit

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

* fix: quality changes
  • Loading branch information
luisfelipec95 authored Jun 25, 2024
1 parent 99d2229 commit 52ef629
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion eox_tenant/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=['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 @@ -22,3 +29,18 @@ def test_current_settings_code_imports(self):
import eox_tenant.edxapp_wrapper.backends.bearer_authentication_l_v1 # isort:skip
import eox_tenant.edxapp_wrapper.backends.edxmako_l_v1 # isort:skip
import eox_tenant.edxapp_wrapper.backends.edx_auth_n_v1 # isort:skip

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

Please sign in to comment.