mysociety / mapit.mysociety.org

A Django project for running mySociety's main instance of MapIt for the UK
http://mapit.mysociety.org
Other
6 stars 2 forks source link

Ensure reset_ip_quotas matches IPv4 and IPv6 addresses #137

Closed sagepe closed 2 years ago

sagepe commented 2 years ago

This just adapts the glob used so it will catch colons or dots.

codecov[bot] commented 2 years ago

Codecov Report

Merging #137 (2ab4860) into master (6c3ccac) will increase coverage by 0.10%. The diff coverage is 100.00%.

:exclamation: Current head 2ab4860 differs from pull request most recent head 73a576f. Consider uploading reports for the commit 73a576f to get more accurate results

@@            Coverage Diff             @@
##           master     #137      +/-   ##
==========================================
+ Coverage   86.38%   86.49%   +0.10%     
==========================================
  Files          48       48              
  Lines        2116     2132      +16     
==========================================
+ Hits         1828     1844      +16     
  Misses        288      288              
Impacted Files Coverage Δ
...bscriptions/management/commands/reset_ip_quotas.py 100.00% <100.00%> (ø)
subscriptions/tests.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6c3ccac...73a576f. Read the comment docs.

sagepe commented 2 years ago

Does this test the redis entries get removed (I mean, did it before, am I missing something?)

Funny you should ask that. I don't think it did (or does) unless there's something I don't understand in the way the call_command works.

I started looking at how to add this, but quickly hit up against the limits of my knowledge on python unit testing - I wasn't sure whether to dive down a rabbit hole of learning how to get something like AssertIsNone to work, or whether something simple like just calling r.get afterwards and checking the result would work? If the latter, I can probably add something fairly easily, the former I might realistically need to pair or something to get a bit more up-to-speed on the unit testing. (Plus, I'm currently relying on actions to run tests!)

I'll give it one more pass, then perhaps you can comment on that.