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

Add Hypothesis[django] #4

Merged
merged 5 commits into from Oct 9, 2016

Conversation

Projects
None yet
2 participants
@jamescooke
Owner

jamescooke commented Oct 9, 2016

Use Hypothesis's django extras package and call for an example.

@jamescooke

This comment has been minimized.

Show comment
Hide comment
@jamescooke

jamescooke Oct 9, 2016

Owner

The reason that Hypothesis[django] is RED 🔴 is because model(Item).example() does not reliably generate valid data. There could be two solutions, if either were provided by the library then it would be bumped up to GREEN 💚 ...

Maybe either or both of these exist already and I've missed them - that would be optimal 😄

Owner

jamescooke commented Oct 9, 2016

The reason that Hypothesis[django] is RED 🔴 is because model(Item).example() does not reliably generate valid data. There could be two solutions, if either were provided by the library then it would be bumped up to GREEN 💚 ...

Maybe either or both of these exist already and I've missed them - that would be optimal 😄

@DRMacIver

This comment has been minimized.

Show comment
Hide comment
@DRMacIver

DRMacIver Oct 9, 2016

You could do model(Item).filter(lambda item: item.full_clean()).

I actually thought this was already happening, but I think maybe that was in a pull request that got abandoned.

DRMacIver commented Oct 9, 2016

You could do model(Item).filter(lambda item: item.full_clean()).

I actually thought this was already happening, but I think maybe that was in a pull request that got abandoned.

@DRMacIver

This comment has been minimized.

Show comment
Hide comment
@DRMacIver

DRMacIver Oct 9, 2016

Hmm. Actually that won't work perfectly. There will still be invalid items in the database, but it won't return them from the example.

DRMacIver commented Oct 9, 2016

Hmm. Actually that won't work perfectly. There will still be invalid items in the database, but it won't return them from the example.

@jamescooke

This comment has been minimized.

Show comment
Hide comment
@jamescooke

jamescooke Oct 9, 2016

Owner

@DRMacIver Thanks for checking this out. I feel sad that this doesn't work with Hypothesis out of the box (yet). Hopefully I'll be able to look some more at Hypothesis[django] and see if there's any quick win that could mean that example(valid=True) could become a reality.

If you find that abandoned PR please stick it on here or tweet it to me - I'd be excited to look it over.

Owner

jamescooke commented Oct 9, 2016

@DRMacIver Thanks for checking this out. I feel sad that this doesn't work with Hypothesis out of the box (yet). Hopefully I'll be able to look some more at Hypothesis[django] and see if there's any quick win that could mean that example(valid=True) could become a reality.

If you find that abandoned PR please stick it on here or tweet it to me - I'd be excited to look it over.

@jamescooke jamescooke merged commit 3b71f0c into master Oct 9, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@jamescooke jamescooke deleted the james/hypothesis branch Oct 9, 2016

@jamescooke

This comment has been minimized.

Show comment
Hide comment
@jamescooke

jamescooke Oct 12, 2016

Owner

Note to self - abandoned PR in Hypothesis is here: HypothesisWorks/hypothesis#335

Owner

jamescooke commented Oct 12, 2016

Note to self - abandoned PR in Hypothesis is here: HypothesisWorks/hypothesis#335

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