Skip to content

Commit

Permalink
add test case for grants method
Browse files Browse the repository at this point in the history
  • Loading branch information
Jer-Sch committed Sep 27, 2021
1 parent f7a528a commit ed5d9b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/grants/tests/models/test_grant_clr.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ def test_grants_method_calls_filter_with_expected_parameters(self):
def test_grants_method_calls_filter_with_expected_parameters_if_collection_filters_are_present(self):
grant_clr = GrantCLRFactory()
grant_clr.collection_filters={'1': GrantCollectionFactory()}
grants = Grant.objects.filter(hidden=False, active=True, is_clr_eligible=True, link_to_new_grant=None)

with patch.object(GrantCollection.objects, 'filter') as filter:
with patch.object(GrantCollection.objects.filter(**grant_clr.collection_filters), 'values_list') as values_list:
Expand All @@ -218,7 +219,7 @@ def test_grants_method_does_not_call_filter_if_collection_filters_are_not_presen
grant_clr.grants

filter.assert_not_called
values_list.assert_not_called
values_list.assert_not_called

def test_record_clr_prediction_curve_calls_collaborator_with_expected_parameters(self):
"""Test record_clr_prediction_curve calls create on GrantCLRCalculation.objects with expected params."""
Expand Down

0 comments on commit ed5d9b9

Please sign in to comment.