-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add test integration * fix: remove commit * feat: add test integration * fix: pylint fixes * fix: pylint fixes * fix: pylint fixes * fix: pylint fixes * fix: pylint fixes * fix: pylint fixes * fix: pylint fixes * fix: pylint fixes * fix: pylint fixes * fix: remove unused function to test integration * fix: pylint fixes * fix: ignore pylint integration file * fix: pylint fixes * fix: pylint fixes * fix: ignore pylint integration file * fix: ignore pylint integration file * fix: ignore pylint integration file * fix: ignore pylint integration file * fix: ignore pylint integration file * fix: refactor integration test * fix: refactor integration test * fix: refactor integration test * fix: pylint error * fix: remove pylint ignore * fix: comment test settings * fix: comment test settings * fix: comment test settings * fix: comment test settings
- Loading branch information
1 parent
ff81da1
commit bfad685
Showing
16 changed files
with
73 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
""" | ||
Simple backend that returns the platform's models | ||
""" | ||
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(): | ||
"""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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
Test integration file. | ||
""" | ||
from django.test import TestCase | ||
|
||
|
||
class TutorIntegrationTestCase(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_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.models_l_v1 # isort:skip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ coverage | |
mock | ||
testfixtures | ||
requests | ||
pyyaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters