Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Sistem Informasi Zakat
Sizakat 5.0 (Refactoring)
Sizakat Backend
Commits
6028d9ab
Commit
6028d9ab
authored
Aug 27, 2020
by
abdurrafiarief
Committed by
hashlash
Aug 27, 2020
Browse files
[RED] Add SDM search with picname test
parent
49263b7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
sizakat/mustahik/tests.py
View file @
6028d9ab
...
...
@@ -871,3 +871,38 @@ class MustahikGraphQLTestCase(GraphQLTestCase):
datasource_warga
=
datasource
[
'dataSourceDetail'
]
kelurahan
=
datasource_warga
.
get
(
'village'
,
None
)
self
.
assertIn
(
kelurahan
,
[
'pinangranti'
,
None
])
def
test_query_search_by_picname
(
self
):
response
=
self
.
query
(
'''
{
dataSources(picNameContains:"pic test") {
id
category
dataSourceDetail {
__typename
... on DataSourceInstitusiType {
picName
name
}
... on DataSourcePekerjaType {
picName
profession
location
}
... on DataSourceWargaType {
picName
rt
rw
village
}
}
}
}
'''
)
self
.
assertResponseNoErrors
(
response
)
datasources
=
json
.
loads
(
response
.
content
)[
'data'
][
'dataSources'
]
for
datasource
in
datasources
:
datasourceDetails
=
datasource
[
'dataSourceDetail'
]
picName
=
datasourceDetails
.
get
(
'picName'
,
None
)
self
.
assertIn
(
picName
,
[
'pic test'
,
None
])
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment