Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
delcroip committed Oct 31, 2024
1 parent 09b067a commit 0bd733c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion contract/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class Meta:
STATE_DISPUTED = 9
STATE_TERMINATED = 10
STATE_COUNTER = 11

def contract_business_validity(self, prefix=''):
return [
models.Q(**{f'{prefix}date_valid_to__isnull': True})
Expand Down
24 changes: 10 additions & 14 deletions contract/tests/test_mutation_create_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def setUpClass(cls):
cls.date_to = str((cls.time_stamp + datetime.timedelta(days=60)).date())
# create contribution plans etc
cls.contribution_plan_bundle = create_test_contribution_plan_bundle()

cls.contribution_plan = create_test_contribution_plan(
custom_props={
"json_ext": {"calculation_rule": {"rate": cls.rate}},
Expand All @@ -78,7 +78,7 @@ def setUpClass(cls):
"replacement_uuid": cls.contribution_plan.id
}
)

cls.contribution_plan_bundle_details = create_test_contribution_plan_bundle_details(
contribution_plan=cls.contribution_plan,
contribution_plan_bundle=cls.contribution_plan_bundle
Expand Down Expand Up @@ -115,7 +115,7 @@ def setUpClass(cls):
"date_valid_to": "2020-01-01",
}
)

cls.policy_holder_insuree = create_test_policy_holder_insuree(
policy_holder=cls.policy_holder,
contribution_plan_bundle=cls.contribution_plan_bundle,
Expand All @@ -125,8 +125,7 @@ def setUpClass(cls):
"replacement_uuid": cls.contribution_plan.id
}
)



cls.policy_holder_insuree2 = create_test_policy_holder_insuree(
policy_holder=cls.policy_holder,
contribution_plan_bundle=cls.contribution_plan_bundle,
Expand Down Expand Up @@ -242,18 +241,16 @@ def test_mutation_contract_create_with_policy_holder(self):
[(ip.effective_date, ip.expiry_date,) for ip in ips]
)
self.assertTrue(not_covered == [])




# check the contract details

query = f"""
{{
contractContributionPlanDetails(contractDetails_Contract_Id: "{
str(contract.id)}",isDeleted: false,first: 10,orderBy: ["contractDetails_Insuree_Uuid"])
{{
totalCount
pageInfo {{ hasNextPage, hasPreviousPage, startCursor, endCursor}}
edges
{{
Expand All @@ -274,9 +271,9 @@ def test_mutation_contract_create_with_policy_holder(self):
}}
}}
}}
}}
}}
"""

response = self.query(
query,
headers={"HTTP_AUTHORIZATION": f"Bearer {self.user_token}"},
Expand All @@ -287,7 +284,7 @@ def test_mutation_contract_create_with_policy_holder(self):

# check covered persons query

query = f"""
query = f"""
{{
insureePolicy(additionalFilter: "{{\\"contract\\":\\"{str(contract.id)}\\"}}",first: 10,orderBy: ["insuree"])
{{
Expand All @@ -310,7 +307,6 @@ def test_mutation_contract_create_with_policy_holder(self):
content = json.loads(response.content)['data']
self.assertEqual(len(content["insureePolicy"]["edges"]), 4, "number of insuree Policy is not as expected")


def find_by_id_query(self, query_type, id, context=None):
query = f"""
{{
Expand Down

0 comments on commit 0bd733c

Please sign in to comment.