Skip to content

Commit 56b1142

Browse files
committed
Merge PR #246 into 18.0
Signed-off-by nimarosa
2 parents 8f907b9 + 1f9b441 commit 56b1142

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

payroll/tests/test_payslip_flow.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,20 @@ def test_get_contracts_singleton(self):
223223
len(contracts), 1, "There is one open contract for the employee"
224224
)
225225

226-
self.sally.contract_id.date_end = (Date.today() - timedelta(days=1)).strftime(
227-
"%Y-%m-%d"
226+
first_contract = self.sally.contract_id
227+
end_date = first_contract.date_start
228+
first_contract.write(
229+
{
230+
"date_end": end_date.strftime("%Y-%m-%d"),
231+
"state": "close",
232+
}
228233
)
234+
second_start = end_date + timedelta(days=1)
229235
self.Contract.create(
230236
{
231237
"name": "Second contract for Sally",
232238
"employee_id": self.sally.id,
233-
"date_start": Date.today().strftime("%Y-%m-%d"),
239+
"date_start": second_start.strftime("%Y-%m-%d"),
234240
"struct_id": self.sales_pay_structure.id,
235241
"wage": 6500.00,
236242
"state": "open",

0 commit comments

Comments
 (0)