Skip to content

Commit

Permalink
remove error on ci teardown
Browse files Browse the repository at this point in the history
  • Loading branch information
delcroip committed Sep 10, 2024
1 parent 4b12206 commit b49a524
Showing 1 changed file with 5 additions and 98 deletions.
103 changes: 5 additions & 98 deletions policy/tests/test_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,17 +175,6 @@ def eligibility_serv(self, category):
self.assertIsNotNone(native_response)
self.assertEquals(native_response, expected_resposnse)

family.delete()
claim.dedrems.all().delete()
claim_service.delete()
claim.delete()
product_service.delete()
svc_pl_detail.delete()
service.delete()
policy.insuree_policies.all().delete()
policy.delete()
product.delete()
insuree.delete()

def test_eligibility_item(self):
if not connection.vendor == "mssql":
Expand Down Expand Up @@ -233,17 +222,6 @@ def test_eligibility_item(self):
self.assertIsNotNone(native_response)
self.assertEquals(native_response, expected_resposnse)

family.delete()
claim.dedrems.all().delete()
claim_item.delete()
claim.delete()
product_item.delete()
item_pl_detail.delete()
item.delete()
policy.insuree_policies.all().delete()
policy.delete()
product.delete()
insuree.delete()

def test_eligibility_by_insuree(self):
if not connection.vendor == "mssql":
Expand Down Expand Up @@ -291,17 +269,7 @@ def test_eligibility_by_insuree(self):
self.assertIsNotNone(native_response)
self.assertEquals(native_response, expected_resposnse)

family.delete()
claim.dedrems.all().delete()
claim_item.delete()
claim.delete()
product_item.delete()
item_pl_detail.delete()
item.delete()
policy.insuree_policies.all().delete()
policy.delete()
product.delete()
insuree.delete()


@skip("Not sure what is the proper behaviour when an IP is not present, skipping for now so that the main case"
"can be fixed.")
Expand All @@ -326,14 +294,6 @@ def test_eligibility_stored_proc_item_no_insuree_policy(self):
self.assertIsNotNone(sp_response)
self.assertEquals(native_response, sp_response)

product_item.delete()
item_pl_detail.delete()
item.delete()
policy.insuree_policies.all().delete()
policy.delete()
product.delete()
insuree.delete()

def test_eligibility_signal(self):

insuree, family = create_test_insuree_for_policy()
Expand Down Expand Up @@ -369,17 +329,7 @@ def signal_before(sender, **kwargs):
self.assertEquals(response.total_admissions_left, 444719)

signal_eligibility_service_before.disconnect(signal_before)
claim.dedrems.all().delete()
claim_item.delete()
claim.delete()
product_item.delete()
item_pl_detail.delete()
item.delete()
policy.insuree_policies.all().delete()
policy.delete()
product.delete()
insuree.delete()
family.delete()



class RenewalsTestCase(TestCase):
Expand Down Expand Up @@ -427,16 +377,7 @@ def test_insert_renewals(self):
should_not_renew = renewals.filter(policy=policy_not_expiring).first()
self.assertIsNone(should_not_renew)

# tearDown
renewals.delete()
inspolicy_expiring.delete()
policy_expiring.delete()
inspolicy_not_expiring.delete()
policy_not_expiring.delete()
officer.delete()
product.delete()
insuree.delete()
family.delete()


def test_update_renewals(self):
# Given
Expand Down Expand Up @@ -470,15 +411,7 @@ def test_update_renewals(self):
self.assertEquals(policy_expiring.status, Policy.STATUS_EXPIRED)
self.assertEquals(policy_not_expired_yet.status, Policy.STATUS_ACTIVE)

# tearDown
inspolicy_expiring.delete()
policy_expiring.delete()
inspolicy_not_expired_yet.delete()
policy_not_expired_yet.delete()
officer.delete()
product.delete()
insuree.delete()
family.delete()


def test_renewals_sms(self):
# Given
Expand Down Expand Up @@ -532,16 +465,7 @@ def test_renewals_sms(self):
self.assertIn(family.location.parent.parent.name, officer_sms[0].sms_message)
self.assertIn("Test product VISIT", officer_sms[0].sms_message)

# tearDown
officer.policy_renewals.all().delete()
policy_expiring.insuree_policies.all().delete()
policy_expiring.delete()
policy_not_expired_yet.insuree_policies.all().delete()
policy_not_expired_yet.delete()
officer.delete()
product.delete()
insuree.delete()
family.delete()


def test_insert_renewal_details(self):
# Given
Expand Down Expand Up @@ -595,20 +519,3 @@ def test_insert_renewal_details(self):
self.assertEquals(len(old_sms), 1)
self.assertTrue(f"HOF\n{insuree_oldpic.chf_id}\nTest Last First Second\n\n" in old_sms[0])

# tearDown
renewals_old.first().details.all().delete()
renewals_old.delete()
renewals_new.first().details.all().delete()
renewals_new.delete()
inspolicy_old_pic.delete()
policy_old_pic.delete()
inspolicy_new_pic.delete()
policy_new_pic.delete()
officer.delete()
product.delete()
photo_newpic.delete()
photo_oldpic.delete()
insuree_oldpic.delete()
family_oldpic.delete()
insuree_newpic.delete()
family_newpic.delete()

0 comments on commit b49a524

Please sign in to comment.