-
-
Notifications
You must be signed in to change notification settings - Fork 776
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
0/Test Donation model #9391
0/Test Donation model #9391
Conversation
name='end_date', | ||
field=models.DateTimeField(default=grants.models.match_pledge.next_month), | ||
), | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this help?
t seems like we are adding the same operation again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thelostone-mc You're right, this doesn't help the Donation tests at all 🙂 This is from #9483 - the integration branch for this PR that this was branched off of which is still waiting to be merged.
The issue this resolves is that with the grants models in their own files rather than one file, next_month
needs to be accessed by calling grants.models.match_pledge.next_month
rather than grants.models.next_month
. I didn't want to directly edit a migration that was already run in production, so I added the change as a try/except
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a comment
fc10e49
to
f1e3da2
Compare
69bb98a
to
81f1318
Compare
* create new directory for models, copy over Contribution model * extract grants models to individual files * rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies * extract CLRMatch into separate file * extract Flag into separate file * extract MatchPledge to separate file * extract Donation and PhantomFunding * extract GrantStat into separate file * refactor * extract GrantBrandingRoutingPolicy to separate file * update migration * add missing import to MatchPledge, remove imports from __init__.py * add missing import * decouple GrantCLRCalculation and move to own file * extract GrantType to own file * extract GrantCLR to own file * add missing import * refactor, add missing imports * remove whitespace * resolve circular dependency * run 'make fix' * import changes from gitcoinco#9314 * add try/except to migration file instead of editing migration directly * refactor
f1e3da2
to
cbbfae3
Compare
Description
This PR adds unit tests to the Donation model
Refers/Fixes
Testing