Fakultas Ilmu Komputer UI

Commit 97b85483 authored by abdurrafiarief's avatar abdurrafiarief
Browse files

[GREEN] complete task for search mustahik with name

parent d85ecd8b
......@@ -25,7 +25,9 @@ class MustahikQuery(graphene.ObjectType):
return mustahik
def resolve_mustahikWithName(self, info, name=""):
return
if name != "":
return Mustahik.objects.filter(name__icontains=name)
return Mustahik.objects.all()
......@@ -316,7 +316,7 @@ class MustahikGraphQLTestCase(GraphQLTestCase):
self.assertEqual(len(content['data']['mustahikWithName']),1)
self.assertEqual(content['data']['mustahikWithName'][0]['name'], 'mustahik')
def test_mustahikWithName_if_name_is_set_should_return_list_of_mustahiks_with_contain_the_name(self):
def test_mustahikWithName_if_name_is_set_should_return_list_of_mustahiks_that_contain_the_name(self):
Mustahik.objects.create(
name='test',
no_ktp='11751234567890',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment