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

Move mockredis to test requirements #115

Closed
wants to merge 1 commit into from

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Feb 13, 2018

It is not necessary to be installed typically.

It is not necessary to be installed typically.
@blueyed
Copy link
Contributor Author

blueyed commented Feb 13, 2018

It might make sense to remove the DEFENDER_MOCK_REDIS setting altogether - which makes this kind of supported.
Or, when leaving it, it should be documented that mockredis needs to get installed, too.

@coveralls
Copy link

coveralls commented Feb 13, 2018

Coverage Status

Coverage decreased (-0.02%) to 91.404% when pulling db9377d on blueyed:move-mockredis into 5aa69ba on kencochrane:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 91.404% when pulling db9377d on blueyed:move-mockredis into 5aa69ba on kencochrane:master.

@coveralls
Copy link

coveralls commented Feb 13, 2018

Coverage Status

Coverage decreased (-0.02%) to 91.404% when pulling db9377d on blueyed:move-mockredis into 5aa69ba on kencochrane:master.

Copy link
Collaborator

@kencochrane kencochrane left a comment

Choose a reason for hiding this comment

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

Thanks, left a comment.

global MOCKED_REDIS
if MOCKED_REDIS is None:
import mockredis
MOCKED_REDIS = mockredis.mock_strict_redis_client()
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can probably make this even more simple.

if config.MOCK_REDIS:
    import mockredis
    return mockredis.mock_strict_redis_client()

Then we can remove the MOCKED_REDIS variable all together what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense.

Please feel free to pick up this PR and/or do it from scratch - I've decided to not use django-defender, so will not update it myself.

kencochrane added a commit that referenced this pull request Feb 20, 2018
Signed-off-by: Ken Cochrane <KenCochrane@gmail.com>
@kencochrane
Copy link
Collaborator

closing, and replacing with #119

kencochrane added a commit that referenced this pull request Feb 20, 2018
Signed-off-by: Ken Cochrane <KenCochrane@gmail.com>
@blueyed blueyed deleted the move-mockredis branch February 20, 2018 23:48
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.

3 participants