fix unit tests
This commit is contained in:
parent
d67f41f32b
commit
0adaedafb6
|
|
@ -24,7 +24,21 @@ class NewContentBlockMutationTest(TestCase):
|
||||||
def test_add_new_content_block(self):
|
def test_add_new_content_block(self):
|
||||||
self.assertEqual(ContentBlock.objects.count(), 1)
|
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"
|
title = "Hello World"
|
||||||
|
|
||||||
|
|
@ -59,7 +73,21 @@ class NewContentBlockMutationTest(TestCase):
|
||||||
def test_addNewContentBlock_withImageUrlBlock(self):
|
def test_addNewContentBlock_withImageUrlBlock(self):
|
||||||
self.assertEqual(ContentBlock.objects.count(), 1)
|
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"
|
title = "Hello World"
|
||||||
|
|
||||||
|
|
@ -67,6 +95,7 @@ class NewContentBlockMutationTest(TestCase):
|
||||||
'input': {
|
'input': {
|
||||||
"contentBlock": {
|
"contentBlock": {
|
||||||
"title": title,
|
"title": title,
|
||||||
|
"type": "NORMAL",
|
||||||
"contents": [
|
"contents": [
|
||||||
{
|
{
|
||||||
"type": "image_url_block",
|
"type": "image_url_block",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue