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

refactor (testing): preserve raw path in scope creation #2331

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

Conversation

aarcex3
Copy link
Contributor

@aarcex3 aarcex3 commented Sep 17, 2024

Summary of Changes

Added a 'raw_path' key to the asgi scope in create_scope to preserve the path and keep consistency as per #2159

Related Issues

#2262

Pull Request Checklist

  • Added tests for changed code.
  • Coding style is consistent with the rest of the framework.

@aarcex3
Copy link
Contributor Author

aarcex3 commented Sep 17, 2024

I have an issue with mypy, dunno if it's only me. It complains about line 680 in testing/helpers.py.

Copy link

codecov bot commented Sep 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (e470e62) to head (42450de).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2331   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           63        63           
  Lines         7593      7594    +1     
  Branches      1282      1282           
=========================================
+ Hits          7593      7594    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@vytas7 vytas7 left a comment

Choose a reason for hiding this comment

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

Thanks for this initiative @aarcex3!

However, it seems there is a misunderstanding regarding the actual implementation.
In ASGI, raw path is presented as the raw_path key inside scope. The value is a bytestring path, excluding any query string.

Furthermore, I think this improvement warrants a newsfragment, let's add one.

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

Successfully merging this pull request may close these issues.

2 participants