test: fix (and simplify) changed email address generation#4919
Merged
rjsparks merged 1 commit intoDec 19, 2022
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4919 +/- ##
==========================================
- Coverage 88.47% 88.46% -0.01%
==========================================
Files 296 296
Lines 39795 39806 +11
==========================================
+ Hits 35208 35214 +6
- Misses 4587 4592 +5
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
rjsparks
approved these changes
Dec 19, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a better fix than #4918. The generate-and-check loop with the
EmailFactorywas nonsense. The loop checked whether twoEmailinstances were the same which would never be true (aside from the initial test before the factory was called). The condition should have tested equality ofEmail.address, but that is the primary key for the model/table so was guaranteed to be different unless the factory had caused a primary key collision.This just specifies a changed email address and gets rid of the loop and randomness.