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

[IMP] sustainability: validity date tests #244

Open
wants to merge 5 commits into
base: 17.0
Choose a base branch
from

Conversation

jacopobacci
Copy link
Contributor

…d invoice creation in tests

Enhance the test setup by adding more carbon factors, values, and types.
Introduce a new product, account, and invoice creation to simulate real-world
scenarios. This improves test coverage and ensures robustness in handling
various carbon factor configurations and related entities.
Move carbon factor and related setup from common.py to test_conversion.py
to streamline test setup and improve maintainability. This change reduces
redundancy and ensures that test data is only initialized where necessary,
enhancing the clarity and focus of the test suite.
Add creation of a carbon factor value with a specific date and value
to ensure the default fallback factor has an associated value. This
enhances test coverage by verifying the behavior of carbon factor
values in the system.
Add `test_carbon_computation.py` to verify carbon factor values
are correctly applied based on invoice dates. This ensures the
system accurately computes carbon values for both matching and
earlier invoice dates, enhancing reliability in sustainability
calculations.
@jacopobacci jacopobacci self-assigned this Jan 21, 2025
@sustainabilitybot
Copy link
Collaborator

Hi @BonnetAdam, @jguenat,
some modules you are maintaining are being modified, check this out!

@@ -8,13 +8,18 @@ class CarbonCommon(TransactionCase):
def setUpClass(cls):
super().setUpClass()

# Disable tracking test suite
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
Copy link
Member

Choose a reason for hiding this comment

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

you can directly add the no_reset_password=True to this context

Copy link
Member

Choose a reason for hiding this comment

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

with with_context

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why not making a code suggestion directly, while explaining why you want this change?

… category setup to streamline test setup and improve maintainability
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.

Define functional Test Scenarios for the core engine management of validity date
3 participants