@@ -161,7 +161,7 @@ def unique(request, freezed_time):
161
161
return f"{ prefix } -{ int (freezed_time .timestamp ())} "
162
162
163
163
164
- def relative_time (freezed_time , iso , is_iso_with_timezone_indicator ):
164
+ def relative_time (freezed_time , iso ):
165
165
time_re = re .compile (r"now( *([+-]) *(\d+)([smhdMy]))?" )
166
166
167
167
def func (arg ):
@@ -185,16 +185,9 @@ def func(arg):
185
185
elif unit == "y" :
186
186
ret += relativedelta (years = num )
187
187
if iso :
188
- if is_iso_with_timezone_indicator :
189
- # Return ISO 8601 formatted string with Z timezone indicator
190
- # Example: 2025-04-17T03:17:07.923Z
191
- from datetime import timezone
192
-
193
- return ret .astimezone (timezone .utc ).isoformat (timespec = "milliseconds" ).replace ("+00:00" , "Z" )
194
- else :
195
- return ret .replace (tzinfo = None ) # return datetime object and not string
196
- # NOTE this is not a full ISO 8601 format, but it's enough for our needs
197
- # return ret.strftime('%Y-%m-%dT%H:%M:%S') + ret.strftime('.%f')[:4] + 'Z'
188
+ return ret .replace (tzinfo = None ) # return datetime object and not string
189
+ # NOTE this is not a full ISO 8601 format, but it's enough for our needs
190
+ # return ret.strftime('%Y-%m-%dT%H:%M:%S') + ret.strftime('.%f')[:4] + 'Z'
198
191
199
192
return int (ret .timestamp ())
200
193
return ""
@@ -227,8 +220,8 @@ def context(vcr, unique, freezed_time):
227
220
"unique_lower_alnum" : PATTERN_ALPHANUM .sub ("" , unique ).lower (),
228
221
"unique_upper_alnum" : PATTERN_ALPHANUM .sub ("" , unique ).upper (),
229
222
"unique_hash" : unique_hash ,
230
- "timestamp" : relative_time (freezed_time , False , False ),
231
- "timeISO" : relative_time (freezed_time , True , is_iso_with_timezone_indicator ),
223
+ "timestamp" : relative_time (freezed_time , False ),
224
+ "timeISO" : relative_time (freezed_time , True ),
232
225
"uuid" : generate_uuid (freezed_time ),
233
226
}
234
227
@@ -512,7 +505,7 @@ def build_param(p):
512
505
json .loads (Template (p ["value" ]).render (** context )),
513
506
)
514
507
return open (filepath )
515
- return json . loads (Template (p ["value" ]).render (** context ))
508
+ return client . deserialize (Template (p ["value" ]).render (** context ), openapi_types , True )
516
509
if "source" in p :
517
510
return glom (context , p ["source" ])
518
511
0 commit comments