-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
Clean up Invoicing Tests #35576
base: master
Are you sure you want to change the base?
Clean up Invoicing Tests #35576
Conversation
is_testing_web_user_feature = False | ||
|
||
@classmethod | ||
def setUpClass(cls): |
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.
move to setUp
instead of setUpClass
, and likewise with tearDownClass
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.
(additionally, better to move tearDown
functionality to cleanup classes, so that cleanup actually executes if an error occurs)
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.
After working on this for a couple hours, it's looking pretty messy to try and move the subscription setup entirely out of the class method, based on various subclasses assuming (reasonably) that there is always a default subscription.
Rather than explicitly assigning subscriptions in each of those subclasses, I may end up instead, for test cases that need a unique subscription (rather than the default), explicitly replacing that default subscription instead of adding a new one (which I believe was @jingcheng16 's concern in test_community_invoice
, that we were just generating a new subscription but leaving still leaving the old one intact)
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.
Actually, that wouldn't quite work either, because then further test cases would be missing the expected class-subscription. It's specifically the TestBillingAutoPay
classes that make heavy use of the class-subscription, so maybe I can restructure those a bit to work with a subscription that gets set per-test case.
Technical Summary
Reorganizes and lightly refactors invoicing test suites. Specifically removes
TestDomainInvoiceFactory
because most of that functionality is already covered inTestInvoice
, and in review here it became clear that the distinction was blurry and likely unnecessary.Review by commit.
Safety Assurance
Safety story
Changes automated tests only, no change to functional code.
Automated test coverage
It's automated tests all the way down.
QA Plan
Nope.
Rollback instructions
Labels & Review