@@ -9,6 +9,7 @@ class SomeModel(BaseModel):
99 i : int
1010 s : str
1111 f : float
12+ n : int | None = None
1213
1314
1415class OtherModel (BaseModel ):
@@ -86,7 +87,12 @@ def view7(request, obj: OtherModel = OtherModel(x=1, y=1)):
8687 (
8788 "/test1" ,
8889 dict (json = {"i" : "1" , "s" : "foo" , "f" : "1.1" }),
89- {"i" : 1 , "s" : "foo" , "f" : 1.1 },
90+ {"i" : 1 , "s" : "foo" , "f" : 1.1 , "n" : None },
91+ ),
92+ (
93+ "/test1" ,
94+ dict (json = {"i" : "1" , "s" : "foo" , "f" : "1.1" , "n" : 42 }),
95+ {"i" : 1 , "s" : "foo" , "f" : 1.1 , "n" : 42 },
9096 ),
9197 (
9298 "/test2" ,
@@ -96,12 +102,15 @@ def view7(request, obj: OtherModel = OtherModel(x=1, y=1)):
96102 "other" : {"x" : 1 , "y" : 2 },
97103 }
98104 ),
99- {"some" : {"i" : 1 , "s" : "foo" , "f" : 1.1 }, "other" : {"x" : 1 , "y" : 2 }},
105+ {
106+ "some" : {"i" : 1 , "s" : "foo" , "f" : 1.1 , "n" : None },
107+ "other" : {"x" : 1 , "y" : 2 },
108+ },
100109 ),
101110 (
102111 "/test3" ,
103112 dict (json = {"i" : "1" , "s" : "foo" , "f" : "1.1" }),
104- {"i" : 1 , "s" : "foo" , "f" : 1.1 },
113+ {"i" : 1 , "s" : "foo" , "f" : 1.1 , "n" : None },
105114 ),
106115 (
107116 "/test_form" ,
0 commit comments