From 0adaedafb6b0f74fcc2006c895717dc82833b961 Mon Sep 17 00:00:00 2001 From: Christian Cueni Date: Tue, 16 Oct 2018 15:54:40 +0200 Subject: [PATCH] fix unit tests --- server/books/tests/test_module_mutations.py | 33 +++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/server/books/tests/test_module_mutations.py b/server/books/tests/test_module_mutations.py index ca1aab2f..3ba1363b 100644 --- a/server/books/tests/test_module_mutations.py +++ b/server/books/tests/test_module_mutations.py @@ -24,7 +24,21 @@ class NewContentBlockMutationTest(TestCase): def test_add_new_content_block(self): self.assertEqual(ContentBlock.objects.count(), 1) - mutation = get_graphql_mutation('addContentBlock.gql') + mutation = """ + mutation AddContentBlock($input: AddContentBlockInput!) { + addContentBlock(input: $input) { + newContentBlock { + id + title + slug + contents + type + } + errors + clientMutationId + } + } + """ title = "Hello World" @@ -59,7 +73,21 @@ class NewContentBlockMutationTest(TestCase): def test_addNewContentBlock_withImageUrlBlock(self): self.assertEqual(ContentBlock.objects.count(), 1) - mutation = get_graphql_mutation('addContentBlock.gql') + mutation = """ + mutation AddContentBlock($input: AddContentBlockInput!) { + addContentBlock(input: $input) { + newContentBlock { + id + title + slug + contents + type + } + errors + clientMutationId + } + } + """ title = "Hello World" @@ -67,6 +95,7 @@ class NewContentBlockMutationTest(TestCase): 'input': { "contentBlock": { "title": title, + "type": "NORMAL", "contents": [ { "type": "image_url_block",