Skip to content

Commit

Permalink
update organization filter test case
Browse files Browse the repository at this point in the history
  • Loading branch information
sudan45 committed Jan 8, 2024
1 parent 2ab83db commit de28ff5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions apps/assessment_registry/filter_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ def filter_focuses(self, qs, _, value):
def filter_sectors(self, qs, _, value):
return qs if value is None else qs.filter(sectors__overlap=value)

def filter_details_type(self, qs, _, value):
return qs if value is None else qs.filter(details_type__overlap=value)

def filter_coordinated_joint(self, qs, _, value):
return qs if value is None else qs.filter(coordinated_joint__overlap=value)


AssessmentDashboardFilterDataType, AssessmentDashboardFilterDataInputType = generate_type_for_filter_set(
AssessmentDashboardFilterSet,
Expand Down
8 changes: 4 additions & 4 deletions apps/organization/tests/test_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ def test_organization_query(self):
query MyQuery (
$verified: Boolean
$search: String
$usedInProject: ID
$usedInProjectByLead: ID
) {
organizations(
search: $search
verified: $verified
usedInProject: $usedInProject
usedInProjectByLead: $usedInProjectByLead
ordering: DESC_TITLE
) {
results {
Expand Down Expand Up @@ -96,10 +96,10 @@ def test_organization_query(self):
'verified': False,
}, [org6, org5, org3, org1]),
(user, {
'usedInProject': str(project.id),
'usedInProjectByLead': str(project.id),
}, [org6, org5, org3, org2, org1]),
(non_member_user, {
'usedInProject': str(project.id),
'usedInProjectByLead': str(project.id),
# Return all the organizations (Filter not applied)
}, [org6, org5, org4, org3, org2, org1]),
]:
Expand Down

0 comments on commit de28ff5

Please sign in to comment.