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

Passing username to redis arguments #657

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

Conversation

joachimBurket
Copy link

resolves #656

Copy link
Member

@WisdomPill WisdomPill 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 the contribution! it would be nice to have a test for this and a change log file

The login for the user ``django`` would look like this:

.. code-block:: python

CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://django@localhost:6379/0",
Copy link
Member

Choose a reason for hiding this comment

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

I would keep both examples if they work

Copy link
Author

Choose a reason for hiding this comment

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

I merged the example in which the username is passed in the URL and the password in the OPTIONS with the example of a URL unsafe password, because I thought it was redundant. Tell me if it suits you as done in 039432c

@joachimBurket
Copy link
Author

I added the changelog and a test. I wasn't sure where to test the connection params so I renamed the test_connection_string.py file in test_connection_params.py and added it there with the test of the URL.

@joachimBurket
Copy link
Author

ping ;)

@WisdomPill
Copy link
Member

I would love to have tests to connect to a server with credentials

@codecov
Copy link

codecov bot commented Mar 23, 2023

Codecov Report

Attention: Patch coverage is 40.00000% with 18 lines in your changes missing coverage. Please review.

Project coverage is 56.3%. Comparing base (9d572cd) to head (fc3fd6c).
Report is 172 commits behind head on master.

Files Patch % Lines
tests/test_connection_params.py 33.4% 18 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #657     +/-   ##
========================================
- Coverage    57.5%   56.3%   -1.1%     
========================================
  Files          39      39             
  Lines        2528    2546     +18     
  Branches       75      74      -1     
========================================
- Hits         1452    1432     -20     
- Misses       1059    1097     +38     
  Partials       17      17             
Flag Coverage Δ
mypy 33.7% <30.0%> (-0.1%) ⬇️
tests 83.6% <100.0%> (-<0.1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

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

Successfully merging this pull request may close these issues.

Pass USERNAME to Redis connection_kwargs
2 participants