Skip to content

Add a NoSecurityHash class for fast testing#20

Open
regularfry wants to merge 1 commit into
mainfrom
XXX-speed-up-tests-by-knackering-hash-security
Open

Add a NoSecurityHash class for fast testing#20
regularfry wants to merge 1 commit into
mainfrom
XXX-speed-up-tests-by-knackering-hash-security

Conversation

@regularfry

Copy link
Copy Markdown
Contributor

This is controversial, I know, but I think it's worthwhile.

With this patch applied, run the tests like so:

 $ docker-compose exec -e STUPIDLY_HOBBLE_SECURITY=I_AM_AN_IDIOT_YES_I_REALLY_MEAN_IT web python manage.py test
Found 31 test(s).
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
...............................
----------------------------------------------------------------------
Ran 31 tests in 39.027s

OK

That should be obvious enough that nobody's going to do it by accident. One thing I'm not sure about is if there's a better place to put the NoSecurityHash class so that it can be passed in to the CareRecipientForm, so that we could only have the thing that breaks the security where the tests are, not in code that gets loaded at runtime.

p=6,
maxmem=2**26,
).hex()
if getenv("STUPIDLY_HOBBLE_SECURITY") == "I_AM_AN_IDIOT_YES_I_REALLY_MEAN_IT":

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Feels bad to be doing an env var check here; where should this be?

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.

1 participant