@@ -117,11 +117,11 @@ def test_td_property_with_schema(
117117 helpers , app , thing_description , app_ctx , schemas_path
118118):
119119 class Index (View ):
120+ schema = fields .Int (required = True )
121+
120122 def get (self ):
121123 return "GET"
122124
123- Index .schema = fields .Int (required = True )
124-
125125 app .add_url_rule ("/" , view_func = Index .as_view ("index" ))
126126 rules = app .url_map ._rules_by_endpoint ["index" ]
127127
@@ -151,11 +151,11 @@ def get(self):
151151
152152def test_td_property_write_only (helpers , app , thing_description , app_ctx , schemas_path ):
153153 class Index (View ):
154+ schema = fields .Int ()
155+
154156 def put (self ):
155157 return "PUT"
156158
157- Index .schema = fields .Int ()
158-
159159 app .add_url_rule ("/" , view_func = Index .as_view ("index" ))
160160 rules = app .url_map ._rules_by_endpoint ["index" ]
161161
@@ -196,15 +196,15 @@ def test_td_property_different_response_type(
196196 helpers , app , thing_description , app_ctx , schemas_path
197197):
198198 class Index (View ):
199+ schema = fields .Int ()
200+ responses = {200 : {"content_type" : "text/plain; charset=us-ascii" }}
201+
199202 def get (self ):
200203 return "GET"
201204
202205 def put (self ):
203206 return "PUT"
204207
205- Index .schema = fields .Int ()
206- Index .responses [200 ] = {"content_type" : "text/plain; charset=us-ascii" }
207-
208208 app .add_url_rule ("/" , view_func = Index .as_view ("index" ))
209209 rules = app .url_map ._rules_by_endpoint ["index" ]
210210
0 commit comments