Skip to content

Commit 21e18ae

Browse files
committed
Add test
1 parent 8290326 commit 21e18ae

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

graphene/types/tests/test_inputobjecttype.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
from graphql import Undefined
2+
import pytest
23

34
from ..argument import Argument
45
from ..field import Field
56
from ..inputfield import InputField
6-
from ..inputobjecttype import InputObjectType
7+
from ..inputobjecttype import InputObjectType, InputObjectTypeContainer
78
from ..objecttype import ObjectType
89
from ..scalars import Boolean, String
910
from ..schema import Schema
@@ -167,3 +168,16 @@ def resolve_undefined_optionals_work(self, info, input: TestUndefinedInput):
167168

168169
assert not result.errors
169170
assert result.data == {"undefinedOptionalsWork": True}
171+
172+
173+
def test_inputobjecttype_explicit_container():
174+
class MyInputObjectType(InputObjectType):
175+
class Meta:
176+
container = InputObjectTypeContainer
177+
178+
first_name = String()
179+
last_name = String()
180+
181+
container = MyInputObjectType._meta.container(first_name="John")
182+
assert container.first_name == "John"
183+
assert container.last_name is None

0 commit comments

Comments
 (0)