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

test: add TestPathRedirectionMiddleware integration tests AP-1547 #298

Open
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

BryanttV
Copy link
Contributor

@BryanttV BryanttV commented Oct 28, 2024

Description

This PR adds integration tests for the TestPathRedirectionMiddleware middleware. These tests are executed in the job of Tutor Integration Tests

Testing instructions

Check the jobs of Tutor Integration Tests in the PR.

Jira Issue

@BryanttV BryanttV force-pushed the bav/middleware-integration-tests branch 2 times, most recently from 14220fc to 10dd64f Compare November 1, 2024 16:08
@BryanttV BryanttV force-pushed the bav/middleware-integration-tests branch 9 times, most recently from 86c3ec7 to 5816b47 Compare November 7, 2024 20:14
@BryanttV BryanttV marked this pull request as ready for review November 7, 2024 20:14
@BryanttV BryanttV requested a review from a team as a code owner November 7, 2024 20:14
@BryanttV BryanttV force-pushed the bav/middleware-integration-tests branch 2 times, most recently from 1564138 to 7724856 Compare November 13, 2024 04:11
Copy link
Contributor

@mariajgrimaldi mariajgrimaldi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this PR is ready for review, cause I think an issue was still being addressed. Please, let me know to go through it again :)

eox_core/tests/integration/test_middleware.py Show resolved Hide resolved
class TestPathRedirectionMiddleware(BaseIntegrationTest):
"""Integration tests for the PathRedirectionMiddleware."""

def setUp(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we considering the process_mktg_redirect test case somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I added new tests: ab56e37

@BryanttV BryanttV requested review from mariajgrimaldi and a team November 13, 2024 17:44
@BryanttV BryanttV force-pushed the bav/middleware-integration-tests branch from cf996d8 to 80ed570 Compare November 13, 2024 17:44
Copy link
Contributor

@mariajgrimaldi mariajgrimaldi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a few non-blocking comments for you to address. Other than that, it looks good to me!

return response.json()["access_token"]


ACCESS_TOKEN = get_access_token()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why is this here instead of being in L59? Do other files use it separately?

Base class for the integration test suite.
"""

def __init__(self, *args, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, again. Why are we using __init__ instead of the standard setup for test case classes?

"""
domain = f"{prefix}.{settings['LMS_BASE']}" if prefix else settings["LMS_BASE"]
return {
"base_url": f"http://{domain}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this always going to be http, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants