-
-
Couldn't load subscription status.
- Fork 244
Add test coverage for csrf.py
#1564
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
Conversation
Signed-off-by: bandhan-majumder <[email protected]>
Summary by CodeRabbit
Summary by CodeRabbit
WalkthroughA new test module Changes
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes were found. ✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (6)
backend/tests/apps/core/api/csrf_test.py (6)
1-6: Remove unused import and consider import organization.The
get_tokenimport fromdjango.middleware.csrfis unused according to static analysis and should be removed to keep the imports clean.-from django.middleware.csrf import get_token🧰 Tools
🪛 Ruff (0.11.9)
4-4:
django.middleware.csrf.get_tokenimported but unusedRemove unused import:
django.middleware.csrf.get_token(F401)
11-14: Simplify fixture implementation.Since there's no teardown logic needed, you can use
returninstead ofyieldfor better clarity.@pytest.fixture(autouse=True) def setup_client(self): self.factory = RequestFactory() - yield + return🧰 Tools
🪛 Ruff (0.11.9)
14-14: No teardown in fixture
setup_client, usereturninstead ofyieldReplace
yieldwithreturn(PT022)
16-25: Good helper method with minor refactoring opportunity.The helper method logic is sound, but the conditional can be simplified for better readability.
def _make_request_with_session(self, path="/", method="get"): - if method.lower() == "post": - request = self.factory.post(path) - else: - request = self.factory.get(path) + request = self.factory.post(path) if method.lower() == "post" else self.factory.get(path) request.session = SessionStore() request.session.create() return request🧰 Tools
🪛 Ruff (0.11.9)
17-20: Use ternary operator
request = self.factory.post(path) if method.lower() == "post" else self.factory.get(path)instead ofif-else-blockReplace
if-else-block withrequest = self.factory.post(path) if method.lower() == "post" else self.factory.get(path)(SIM108)
21-21: Blank line contains whitespace
Remove whitespace from blank line
(W293)
24-24: Blank line contains whitespace
Remove whitespace from blank line
(W293)
27-34: Consider using constants for magic values.The helper method is well-structured, but consider using constants for HTTP status codes to improve maintainability.
+from http import HTTPStatus + def _assert_valid_csrf_response(self, response): - assert response.status_code == 200 + assert response.status_code == HTTPStatus.OK assert response["Content-Type"] == "application/json" data = json.loads(response.content) assert "csrftoken" in data assert isinstance(data["csrftoken"], str) assert len(data["csrftoken"]) > 0🧰 Tools
🪛 Ruff (0.11.9)
28-28: Magic value used in comparison, consider replacing
200with a constant variable(PLR2004)
30-30: Blank line contains whitespace
Remove whitespace from blank line
(W293)
67-76: Consider using a constant for token length validation.The test logic is sound, but the magic number for token length could be extracted to a constant.
+MIN_CSRF_TOKEN_LENGTH = 10 + def test_get_csrf_token_response_structure(self): request = self._make_request_with_session() response = get_csrf_token(request) assert response["Content-Type"] == "application/json" data = json.loads(response.content) assert isinstance(data, dict) assert "csrftoken" in data - assert len(data["csrftoken"]) > 10 # CSRF tokens length is typically more than 10 characters + assert len(data["csrftoken"]) > MIN_CSRF_TOKEN_LENGTH # CSRF tokens length is typically more than 10 characters🧰 Tools
🪛 Ruff (0.11.9)
70-70: Blank line contains whitespace
Remove whitespace from blank line
(W293)
72-72: Blank line contains whitespace
Remove whitespace from blank line
(W293)
76-76: Magic value used in comparison, consider replacing
10with a constant variable(PLR2004)
76-76: Line too long (101 > 99)
(E501)
1-96: Consider adding more test scenarios.The current test suite is comprehensive, but consider adding these additional scenarios to further improve coverage:
- Test with POST requests using the existing helper method
- Test behavior when the view is called multiple times with the same session
- Test error handling scenarios if applicable
def test_get_csrf_token_post_request(self): """Test CSRF token endpoint with POST request.""" request = self._make_request_with_session(method="post") response = get_csrf_token(request) self._assert_valid_csrf_response(response) def test_get_csrf_token_same_session_consistency(self): """Test that the same session returns the same token.""" request = self._make_request_with_session() response1 = get_csrf_token(request) response2 = get_csrf_token(request) data1 = json.loads(response1.content) data2 = json.loads(response2.content) # Same session should return the same token assert data1["csrftoken"] == data2["csrftoken"]🧰 Tools
🪛 Ruff (0.11.9)
4-4:
django.middleware.csrf.get_tokenimported but unusedRemove unused import:
django.middleware.csrf.get_token(F401)
14-14: No teardown in fixture
setup_client, usereturninstead ofyieldReplace
yieldwithreturn(PT022)
15-15: Blank line contains whitespace
Remove whitespace from blank line
(W293)
17-20: Use ternary operator
request = self.factory.post(path) if method.lower() == "post" else self.factory.get(path)instead ofif-else-blockReplace
if-else-block withrequest = self.factory.post(path) if method.lower() == "post" else self.factory.get(path)(SIM108)
21-21: Blank line contains whitespace
Remove whitespace from blank line
(W293)
24-24: Blank line contains whitespace
Remove whitespace from blank line
(W293)
26-26: Blank line contains whitespace
Remove whitespace from blank line
(W293)
28-28: Magic value used in comparison, consider replacing
200with a constant variable(PLR2004)
30-30: Blank line contains whitespace
Remove whitespace from blank line
(W293)
35-35: Blank line contains whitespace
Remove whitespace from blank line
(W293)
39-39: Blank line contains whitespace
Remove whitespace from blank line
(W293)
41-41: Blank line contains whitespace
Remove whitespace from blank line
(W293)
45-45: Blank line contains whitespace
Remove whitespace from blank line
(W293)
50-50: Blank line contains whitespace
Remove whitespace from blank line
(W293)
54-54: Blank line contains whitespace
Remove whitespace from blank line
(W293)
57-57: Blank line contains whitespace
Remove whitespace from blank line
(W293)
60-60: Blank line contains whitespace
Remove whitespace from blank line
(W293)
63-63: Blank line contains whitespace
Remove whitespace from blank line
(W293)
66-66: Blank line contains whitespace
Remove whitespace from blank line
(W293)
70-70: Blank line contains whitespace
Remove whitespace from blank line
(W293)
72-72: Blank line contains whitespace
Remove whitespace from blank line
(W293)
76-76: Magic value used in comparison, consider replacing
10with a constant variable(PLR2004)
76-76: Line too long (101 > 99)
(E501)
77-77: Blank line contains whitespace
Remove whitespace from blank line
(W293)
80-80: Blank line contains whitespace
Remove whitespace from blank line
(W293)
83-83: Blank line contains whitespace
Remove whitespace from blank line
(W293)
87-87: Blank line contains whitespace
Remove whitespace from blank line
(W293)
88-88: Single quotes found but double quotes preferred
Replace single quotes with double quotes
(Q000)
90-90: Blank line contains whitespace
Remove whitespace from blank line
(W293)
93-93: Blank line contains whitespace
Remove whitespace from blank line
(W293)
96-96: No newline at end of file
Add trailing newline
(W292)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
backend/tests/apps/core/api/csrf_test.py(1 hunks)
🧰 Additional context used
🪛 Ruff (0.11.9)
backend/tests/apps/core/api/csrf_test.py
4-4: django.middleware.csrf.get_token imported but unused
Remove unused import: django.middleware.csrf.get_token
(F401)
14-14: No teardown in fixture setup_client, use return instead of yield
Replace yield with return
(PT022)
15-15: Blank line contains whitespace
Remove whitespace from blank line
(W293)
17-20: Use ternary operator request = self.factory.post(path) if method.lower() == "post" else self.factory.get(path) instead of if-else-block
Replace if-else-block with request = self.factory.post(path) if method.lower() == "post" else self.factory.get(path)
(SIM108)
21-21: Blank line contains whitespace
Remove whitespace from blank line
(W293)
24-24: Blank line contains whitespace
Remove whitespace from blank line
(W293)
26-26: Blank line contains whitespace
Remove whitespace from blank line
(W293)
28-28: Magic value used in comparison, consider replacing 200 with a constant variable
(PLR2004)
30-30: Blank line contains whitespace
Remove whitespace from blank line
(W293)
35-35: Blank line contains whitespace
Remove whitespace from blank line
(W293)
39-39: Blank line contains whitespace
Remove whitespace from blank line
(W293)
41-41: Blank line contains whitespace
Remove whitespace from blank line
(W293)
45-45: Blank line contains whitespace
Remove whitespace from blank line
(W293)
50-50: Blank line contains whitespace
Remove whitespace from blank line
(W293)
54-54: Blank line contains whitespace
Remove whitespace from blank line
(W293)
57-57: Blank line contains whitespace
Remove whitespace from blank line
(W293)
60-60: Blank line contains whitespace
Remove whitespace from blank line
(W293)
63-63: Blank line contains whitespace
Remove whitespace from blank line
(W293)
66-66: Blank line contains whitespace
Remove whitespace from blank line
(W293)
70-70: Blank line contains whitespace
Remove whitespace from blank line
(W293)
72-72: Blank line contains whitespace
Remove whitespace from blank line
(W293)
76-76: Magic value used in comparison, consider replacing 10 with a constant variable
(PLR2004)
76-76: Line too long (101 > 99)
(E501)
77-77: Blank line contains whitespace
Remove whitespace from blank line
(W293)
80-80: Blank line contains whitespace
Remove whitespace from blank line
(W293)
83-83: Blank line contains whitespace
Remove whitespace from blank line
(W293)
87-87: Blank line contains whitespace
Remove whitespace from blank line
(W293)
88-88: Single quotes found but double quotes preferred
Replace single quotes with double quotes
(Q000)
90-90: Blank line contains whitespace
Remove whitespace from blank line
(W293)
93-93: Blank line contains whitespace
Remove whitespace from blank line
(W293)
96-96: No newline at end of file
Add trailing newline
(W292)
🔇 Additional comments (5)
backend/tests/apps/core/api/csrf_test.py (5)
36-40: Basic functionality test looks good.This test correctly validates the core functionality of the CSRF token endpoint.
🧰 Tools
🪛 Ruff (0.11.9)
39-39: Blank line contains whitespace
Remove whitespace from blank line
(W293)
42-49: JSON structure validation is comprehensive.Good test for ensuring the response contains only the expected key and proper JSON structure.
🧰 Tools
🪛 Ruff (0.11.9)
45-45: Blank line contains whitespace
Remove whitespace from blank line
(W293)
51-65: Excellent test for token uniqueness.This test properly validates that different sessions generate different CSRF tokens, which is crucial for security.
🧰 Tools
🪛 Ruff (0.11.9)
54-54: Blank line contains whitespace
Remove whitespace from blank line
(W293)
57-57: Blank line contains whitespace
Remove whitespace from blank line
(W293)
60-60: Blank line contains whitespace
Remove whitespace from blank line
(W293)
63-63: Blank line contains whitespace
Remove whitespace from blank line
(W293)
78-82: Important edge case coverage.Testing the behavior without a session is crucial for ensuring the endpoint handles edge cases properly.
🧰 Tools
🪛 Ruff (0.11.9)
80-80: Blank line contains whitespace
Remove whitespace from blank line
(W293)
84-96: Thorough response format validation.This test provides comprehensive validation of the JSON response structure and content.
🧰 Tools
🪛 Ruff (0.11.9)
87-87: Blank line contains whitespace
Remove whitespace from blank line
(W293)
88-88: Single quotes found but double quotes preferred
Replace single quotes with double quotes
(Q000)
90-90: Blank line contains whitespace
Remove whitespace from blank line
(W293)
93-93: Blank line contains whitespace
Remove whitespace from blank line
(W293)
96-96: No newline at end of file
Add trailing newline
(W292)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Please start running make check locally
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (2)
backend/tests/apps/core/api/csrf_test.py (2)
16-22: Simplify the helper method parameters.The
methodparameter suggests handling different HTTP methods, but all tests only use GET requests. Consider simplifying this method since the method branching isn't effectively utilized.- def _make_request_with_session(self, path="/", method="get"): - request = self.factory.post(path) if method.lower() == "post" else self.factory.get(path) + def _make_request_with_session(self, path="/"): + request = self.factory.get(path)
39-47: Consider consolidating duplicate test logic.Multiple test methods (
test_get_csrf_token_returns_json,test_get_csrf_token_response_structure, andtest_get_csrf_token_json_response_format) perform very similar validations. Consider consolidating these into fewer, more focused tests to reduce duplication while maintaining coverage.For example, merge the JSON response format validation into the main success test:
def test_get_csrf_token_success(self): request = self._make_request_with_session() response = get_csrf_token(request) self._assert_valid_csrf_response(response) + + # Validate JSON structure + data = json.loads(response.content) + assert list(data.keys()) == ["csrftoken"] + assert len(data) == 1 # Should only contain csrftoken keyAlso applies to: 64-74, 81-93
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
backend/tests/apps/core/api/csrf_test.py(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
backend/tests/apps/core/api/csrf_test.py (1)
backend/apps/core/api/csrf.py (1)
get_csrf_token(11-13)
🪛 Pylint (3.3.7)
backend/tests/apps/core/api/csrf_test.py
[error] 25-25: Instance of 'LookupDict' has no 'ok' member
(E1101)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: CodeQL (python)
- GitHub Check: CodeQL (javascript-typescript)
🔇 Additional comments (1)
backend/tests/apps/core/api/csrf_test.py (1)
11-93: Excellent test coverage for CSRF token functionality.The test suite provides comprehensive coverage of the
get_csrf_tokenview with good separation of concerns:
- ✅ Basic functionality validation
- ✅ Response format verification
- ✅ Token uniqueness across sessions
- ✅ Handling requests without sessions
- ✅ Proper use of Django testing utilities
The tests effectively validate all aspects of the CSRF token endpoint's behavior and will help ensure reliability of this security-critical functionality.
🧰 Tools
🪛 Pylint (3.3.7)
[error] 25-25: Instance of 'LookupDict' has no 'ok' member
(E1101)
* Add test coverage for csrf.py Signed-off-by: bandhan-majumder <[email protected]> * Update code --------- Signed-off-by: bandhan-majumder <[email protected]> Co-authored-by: Arkadii Yakovets <[email protected]>
* Implemented Authentication using nextauth (#1512) * implemented authentication using next-auth * update code * type fix * updated migration * added backend test cases * added frontend unit test cases * added e2e test case * pre-commit * fixes e2e test cases * updated ci/cd * updated code * upgraded mutaitons from graphene to strawberry * updated code * Update code * Update tests * fixes * fix test * added relation * Update code * Update pnpm-lock.yaml --------- Co-authored-by: Kate Golovanova <[email protected]> Co-authored-by: Arkadii Yakovets <[email protected]> Co-authored-by: Arkadii Yakovets <[email protected]> * Run make update * Bump python from 3.13.3-alpine to 3.13.4-alpine in /backend/docker (#1556) Bumps python from 3.13.3-alpine to 3.13.4-alpine. --- updated-dependencies: - dependency-name: python dependency-version: 3.13.4-alpine dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump python from 3.13.3-alpine to 3.13.4-alpine in /schema/docker (#1557) Bumps python from 3.13.3-alpine to 3.13.4-alpine. --- updated-dependencies: - dependency-name: python dependency-version: 3.13.4-alpine dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump python from 3.13.3-alpine to 3.13.4-alpine in /docs/docker (#1559) Bumps python from 3.13.3-alpine to 3.13.4-alpine. --- updated-dependencies: - dependency-name: python dependency-version: 3.13.4-alpine dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Run make update * docs: add Next.js to tech stack after migration (#1565) * Update CONTRIBUTING.md * Update CONTRIBUTING.md --------- Co-authored-by: Arkadii Yakovets <[email protected]> * Update event sync process: fix KeyError 'start-date' * Run make update * Add test coverage for `csrf.py` (#1564) * Add test coverage for csrf.py Signed-off-by: bandhan-majumder <[email protected]> * Update code --------- Signed-off-by: bandhan-majumder <[email protected]> Co-authored-by: Arkadii Yakovets <[email protected]> * Update frontend/pnpm-lock.yaml * Fix Authentication related bugs (#1569) * handle empty auth credentials * update test cases * upgrade code * update code * remove check route * fix test case * fixes and update usermenu --------- Co-authored-by: Arkadii Yakovets <[email protected]> * Merge main * Migrate frontend checks to local environment * Update login page route (#1603) * fix route * format fix * introduce flag for auth * update env * changed default value * fix test cases * fix e2 test cases * Add dynamic variable for isAuthEnabled * Clean up * Clean up and fix tests * Update code * Fix code quality issues --------- Co-authored-by: Arkadii Yakovets <[email protected]> Co-authored-by: Kate <[email protected]> Co-authored-by: Arkadii Yakovets <[email protected]> * Implement GraphQL resolvers for project health metrics (#1577) * Add project_health_metrics node and query * Add health field to the ProjectNode that represents sll ProjectHealthMetrics objects of the project * Add tests * Update filtering and add fields to models * Update filtering * Update tests * Save new boolean values * Add boolean mapping * Add query tests * Merge migrations * Update filtering, add migrations, and update scripts * Update tests and queries * Add test with filters * Update filtering * Update tests * Merge migrations * Revert unnecessary work and apply suggestions * Remove has_no_recent_commits from project * Add missing fields for FE query * Remove project name from the test * Clean migrations * Update code --------- Co-authored-by: Arkadii Yakovets <[email protected]> * Fix test cases and update code (#1635) * update code * fix test case * Update middleware.test.ts * Update code * Update code * Update docker configuration * Update deps --------- Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: bandhan-majumder <[email protected]> Co-authored-by: Raj gupta <[email protected]> Co-authored-by: Kate Golovanova <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: RISHIRAJ MUKHERJEE <[email protected]> Co-authored-by: Bandhan Majumder <[email protected]> Co-authored-by: Ahmed Gouda <[email protected]>
* Implemented Authentication using nextauth (#1512) * implemented authentication using next-auth * update code * type fix * updated migration * added backend test cases * added frontend unit test cases * added e2e test case * pre-commit * fixes e2e test cases * updated ci/cd * updated code * upgraded mutaitons from graphene to strawberry * updated code * Update code * Update tests * fixes * fix test * added relation * Update code * Update pnpm-lock.yaml --------- Co-authored-by: Kate Golovanova <[email protected]> Co-authored-by: Arkadii Yakovets <[email protected]> Co-authored-by: Arkadii Yakovets <[email protected]> * Run make update * Bump python from 3.13.3-alpine to 3.13.4-alpine in /backend/docker (#1556) Bumps python from 3.13.3-alpine to 3.13.4-alpine. --- updated-dependencies: - dependency-name: python dependency-version: 3.13.4-alpine dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump python from 3.13.3-alpine to 3.13.4-alpine in /schema/docker (#1557) Bumps python from 3.13.3-alpine to 3.13.4-alpine. --- updated-dependencies: - dependency-name: python dependency-version: 3.13.4-alpine dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump python from 3.13.3-alpine to 3.13.4-alpine in /docs/docker (#1559) Bumps python from 3.13.3-alpine to 3.13.4-alpine. --- updated-dependencies: - dependency-name: python dependency-version: 3.13.4-alpine dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Run make update * docs: add Next.js to tech stack after migration (#1565) * Update CONTRIBUTING.md * Update CONTRIBUTING.md --------- Co-authored-by: Arkadii Yakovets <[email protected]> * Update event sync process: fix KeyError 'start-date' * Run make update * Add test coverage for `csrf.py` (#1564) * Add test coverage for csrf.py Signed-off-by: bandhan-majumder <[email protected]> * Update code --------- Signed-off-by: bandhan-majumder <[email protected]> Co-authored-by: Arkadii Yakovets <[email protected]> * Update frontend/pnpm-lock.yaml * Fix Authentication related bugs (#1569) * handle empty auth credentials * update test cases * upgrade code * update code * remove check route * fix test case * fixes and update usermenu --------- Co-authored-by: Arkadii Yakovets <[email protected]> * setup mentorship app * created mentor model * created mentee model * created program model * created module model and update relations * updated fields and remove unnecessary migrations * format fix * use through model * cspell update * format fix * Merge main * Migrate frontend checks to local environment * Update login page route (#1603) * fix route * format fix * introduce flag for auth * update env * changed default value * fix test cases * fix e2 test cases * Add dynamic variable for isAuthEnabled * Clean up * Clean up and fix tests * Update code * Fix code quality issues --------- Co-authored-by: Arkadii Yakovets <[email protected]> Co-authored-by: Kate <[email protected]> Co-authored-by: Arkadii Yakovets <[email protected]> * Implement GraphQL resolvers for project health metrics (#1577) * Add project_health_metrics node and query * Add health field to the ProjectNode that represents sll ProjectHealthMetrics objects of the project * Add tests * Update filtering and add fields to models * Update filtering * Update tests * Save new boolean values * Add boolean mapping * Add query tests * Merge migrations * Update filtering, add migrations, and update scripts * Update tests and queries * Add test with filters * Update filtering * Update tests * Merge migrations * Revert unnecessary work and apply suggestions * Remove has_no_recent_commits from project * Add missing fields for FE query * Remove project name from the test * Clean migrations * Update code --------- Co-authored-by: Arkadii Yakovets <[email protected]> * update models and add enrollment model * Fix test cases and update code (#1635) * update code * fix test case * Update middleware.test.ts * Update code * Update code * fixes * updated suggestion * fix format * Update code * Update code * Restore lock files * Reformat migration * Update code * Update code --------- Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: bandhan-majumder <[email protected]> Co-authored-by: Kate Golovanova <[email protected]> Co-authored-by: Arkadii Yakovets <[email protected]> Co-authored-by: Arkadii Yakovets <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: RISHIRAJ MUKHERJEE <[email protected]> Co-authored-by: Bandhan Majumder <[email protected]> Co-authored-by: Ahmed Gouda <[email protected]>



Resolves #1563
This a child pr which covers the coverage of
csrf.pywhich is a part of the parent backend coverage issue.