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
d8bfe8e2
Commit
d8bfe8e2
authored
Aug 07, 2020
by
addffa
Browse files
[RED] membuat test query search datasource
parent
9a263e69
Changes
1
Hide whitespace changes
Inline
Side-by-side
sizakat/mustahik/tests.py
View file @
d8bfe8e2
...
...
@@ -838,3 +838,36 @@ class MustahikGraphQLTestCase(GraphQLTestCase):
content
=
json
.
loads
(
response
.
content
)
self
.
assertTrue
(
content
[
'data'
][
'deleteDataSource'
][
'deleted'
])
self
.
assertEquals
(
DataSource
.
objects
.
count
(),
count
-
1
)
def
test_query_search_data_source_by_name
(
self
):
response
=
self
.
query
(
'''
{
dataSources(nameContains:"pinangranti") {
id
category
dataSourceDetail {
__typename
... on DataSourceInstitusiType {
name
}
... on DataSourcePekerjaType {
profession
location
}
... on DataSourceWargaType {
rt
rw
village
}
}
}
}
'''
)
self
.
assertResponseNoErrors
(
response
)
datasources
=
json
.
loads
(
response
.
content
)[
'data'
][
'dataSources'
]
for
datasource
in
datasources
:
datasource_warga
=
datasource
[
'dataSourceDetail'
]
kelurahan
=
datasource_warga
.
get
(
'village'
,
None
)
self
.
assertIn
(
kelurahan
,
[
'pinangranti'
,
None
])
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