Skip to content

Commit 2a6644a

Browse files
Merge pull request #557 from colts661/remove_test_iu
Removed extra inserted interested users in `test_perk_fulfillment_repo.py`
2 parents 8d4c0bd + cc1b952 commit 2a6644a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

microsetta_private_api/repo/tests/test_perk_fulfillment_repo.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,8 @@ def tearDown(self):
428428
)
429429
cur.execute(
430430
"DELETE FROM campaign.transaction "
431-
"WHERE id IN %s",
431+
"WHERE id IN %s "
432+
"RETURNING interested_user_id",
432433
(
433434
(
434435
FFQ_TRANSACTION_ID,
@@ -439,10 +440,16 @@ def tearDown(self):
439440
),
440441
)
441442
)
443+
inserted_iu_ids = [tup[0] for tup in cur.fetchall()]
442444
cur.execute(
443445
"DELETE FROM campaign.interested_users AS iu "
444446
"WHERE iu.interested_user_id IN %s",
445-
(tuple(self.iu_ids), )
447+
(
448+
(
449+
*inserted_iu_ids,
450+
*self.iu_ids
451+
),
452+
) # self.iu_ids contains iu without transaction
446453
)
447454
cur.execute(
448455
"DELETE FROM campaign.campaigns_projects "

0 commit comments

Comments
 (0)