@@ -9,6 +9,7 @@ class SomeModel(BaseModel):
9
9
i : int
10
10
s : str
11
11
f : float
12
+ n : int | None = None
12
13
13
14
14
15
class OtherModel (BaseModel ):
@@ -86,7 +87,12 @@ def view7(request, obj: OtherModel = OtherModel(x=1, y=1)):
86
87
(
87
88
"/test1" ,
88
89
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 },
90
96
),
91
97
(
92
98
"/test2" ,
@@ -96,12 +102,15 @@ def view7(request, obj: OtherModel = OtherModel(x=1, y=1)):
96
102
"other" : {"x" : 1 , "y" : 2 },
97
103
}
98
104
),
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
+ },
100
109
),
101
110
(
102
111
"/test3" ,
103
112
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 },
105
114
),
106
115
(
107
116
"/test_form" ,
0 commit comments