Skip to content
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

[15.0][IMP] subscription_oca: Tests, refactoring #991

Merged
merged 2 commits into from
Sep 29, 2023

Conversation

ilyasProgrammer
Copy link
Member

No description provided.

@ilyasProgrammer ilyasProgrammer changed the title wip [15.0][IMP] subscription_oca: Tests, refactoring Sep 26, 2023
@francesco-ooops
Copy link
Contributor

@carlos-domatix what do you think about tests?

@simahawk implementation of #971 (review)

Copy link

@simahawk simahawk left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the effort :)

cls.product_1 = cls.env.ref("product.product_product_1")
cls.product_1.taxes_id = [(6, 0, cls.tax_10pc_incl.ids)]
cls.product_2 = cls.env.ref("product.product_product_2")
cls.country_id = cls.env["res.country"].search([], limit=1)

Choose a reason for hiding this comment

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

Suggested change
cls.country_id = cls.env["res.country"].search([], limit=1)
cls.country = cls.env["res.country"].search([], limit=1)

to do for all vars that are records and not IDs

}
)

def test_all_subscription_oca(self):

Choose a reason for hiding this comment

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

Any major reason to have just one biiiig test?
Still better than nothing of course :)
If you don't have time, add a TODO for splitting it

self.assertIsInstance(move_res, dict)

# sale.subscription
self.sub_id.cron_subscription_management()

Choose a reason for hiding this comment

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

this should go to one or more cron specific tests

# sale.subscription.stage
self.stage_id._check_lot_product() # should not raise

# sale.subscription.template

Choose a reason for hiding this comment

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

testing a template? :)

@ilyasProgrammer
Copy link
Member Author

@simahawk Thanks for the review. Please have a look again.

@carlos-domatix
Copy link
Contributor

Thanks a lot for the effort. I see it well but it has 70% coverage https://app.codecov.io/gh/OCA/contract/tree/15.0-subscription_oca-tests/, I don't know if it is enough for the repo, but at least it is a good base.

@simahawk
Copy link

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 15.0-ocabot-merge-pr-991-by-simahawk-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit af706a6 into OCA:15.0 Sep 29, 2023
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 7af1620. Thanks a lot for contributing to OCA. ❤️

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

Successfully merging this pull request may close these issues.

5 participants