Skip to content

Commit

Permalink
Fixed date problem in test_payment_plan_happy_path (#4042)
Browse files Browse the repository at this point in the history
  • Loading branch information
szymon-kellton authored Jul 15, 2024
1 parent af491e8 commit b12ff52
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backend/selenium_tests/payment_module/test_payment_module.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import zipfile
from datetime import datetime
from datetime import datetime, timedelta
from time import sleep

import openpyxl
Expand Down Expand Up @@ -112,7 +112,7 @@ def clear_downloaded_files() -> None:

@pytest.fixture
def create_payment_plan(create_targeting: None) -> PaymentPlan:
tp = TargetPopulation.objects.first()
tp = TargetPopulation.objects.get(program__name="Test Program")
payment_plan = PaymentPlan.objects.update_or_create(
business_area=BusinessArea.objects.only("is_payment_plan_applicable").get(slug="afghanistan"),
target_population=tp,
Expand Down Expand Up @@ -244,7 +244,7 @@ def test_payment_plan_happy_path(
pageNewPaymentPlan.select_listbox_element(targeting.name).click()
pageNewPaymentPlan.getInputStartDate().click()
pageNewPaymentPlan.getInputStartDate().send_keys(
FormatTime(time=program.start_date + relativedelta(day=12)).numerically_formatted_date
FormatTime(time=program.start_date + timedelta(days=12)).numerically_formatted_date
)
pageNewPaymentPlan.getInputEndDate().click()
pageNewPaymentPlan.getInputEndDate().send_keys(FormatTime(time=program.end_date).numerically_formatted_date)
Expand All @@ -260,7 +260,7 @@ def test_payment_plan_happy_path(
assert "Test Program" in pagePaymentModuleDetails.getLabelProgramme().text
assert "CZK" in pagePaymentModuleDetails.getLabelCurrency().text
assert (
FormatTime(time=program.start_date + relativedelta(day=12)).date_in_text_format
FormatTime(time=program.start_date + timedelta(days=12)).date_in_text_format
in pagePaymentModuleDetails.getLabelStartDate().text
)
assert FormatTime(time=program.end_date).date_in_text_format in pagePaymentModuleDetails.getLabelEndDate().text
Expand Down

0 comments on commit b12ff52

Please sign in to comment.