Skip to content

Commit

Permalink
test code
Browse files Browse the repository at this point in the history
  • Loading branch information
FranciscoCubero committed Dec 2, 2024
1 parent e3b509e commit a7b6eab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,6 @@ def test__quit_auvidi_multi__periods_no_auvidi_modcon_yes_auvidi(self, mocked_se
p = self.polissa_obj.browse(self.cursor, self.uid, polissa_id)
self.assertEqual(p.modcontractuals_ids[0].te_auvidi, False)
self.assertEqual(p.modcontractuals_ids[0].state, u'pendent')
observacions = p.modcontractuals_ids[0].observacions
self.assertIn(u'Té AUVIDI: True → False', observacions)
self.assertEqual(len(p.modcontractuals_ids), prev_modcons)
self.assertIn(
u"Pòlisses que estan a periodes amb modcon per passar a indexada + auvidi:", wiz.info)
Expand All @@ -486,7 +484,7 @@ def test__quit_auvidi_multi__periods_no_auvidi_modcon_yes_auvidi(self, mocked_se
def test__quit_auvidi_multi__periods_no_auvidi_modcon_no_auvidi(self, mocked_send_mail):
# Periods no auvidi and modcon neutral --> don't do anything
polissa_id = self.open_polissa("polissa_tarifa_018", 'atr', False)
self.wiz_obj.change_to_indexada(self.cursor, self.uid, polissa_id)
self.wiz_obj.change_to_indexada(self.cursor, self.uid, polissa_id, False)
p = self.polissa_obj.browse(self.cursor, self.uid, polissa_id)
prev_modcons = len(p.modcontractuals_ids)

Expand Down
4 changes: 2 additions & 2 deletions som_auvidi/wizard/wizard_change_to_indexada_auvidi_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def get_list_polissa_names(self, cursor, uid, pol_ids):
pol_data = pol_obj.read(cursor, uid, pol_ids, ["name"])
return ', '.join([pol['name'] for pol in pol_data])

def change_to_indexada(self, cursor, uid, pol_id):
def change_to_indexada(self, cursor, uid, pol_id, auvidi=True):
pol_obj = self.pool.get("giscedata.polissa")
pol = pol_obj.browse(cursor, uid, pol_id)
last_modcon_date = pol.modcontractuals_ids[0].data_final
Expand All @@ -267,7 +267,7 @@ def change_to_indexada(self, cursor, uid, pol_id):
wz_chng_to_indx_obj = self.pool.get("wizard.change.to.indexada")
ctx = {
"active_id": pol_id,
"te_auvidi": True,
"te_auvidi": auvidi,
}
params = {"change_type": "from_period_to_index"}
wiz_id = wz_chng_to_indx_obj.create(cursor, uid, params, context=ctx)
Expand Down

0 comments on commit a7b6eab

Please sign in to comment.