@@ -161,7 +161,7 @@ def unique(request, freezed_time):
161161 return f"{ prefix } -{ int (freezed_time .timestamp ())} "
162162
163163
164- def relative_time (freezed_time , iso , is_iso_with_timezone_indicator ):
164+ def relative_time (freezed_time , iso ):
165165 time_re = re .compile (r"now( *([+-]) *(\d+)([smhdMy]))?" )
166166
167167 def func (arg ):
@@ -185,16 +185,9 @@ def func(arg):
185185 elif unit == "y" :
186186 ret += relativedelta (years = num )
187187 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'
198191
199192 return int (ret .timestamp ())
200193 return ""
@@ -227,8 +220,8 @@ def context(vcr, unique, freezed_time):
227220 "unique_lower_alnum" : PATTERN_ALPHANUM .sub ("" , unique ).lower (),
228221 "unique_upper_alnum" : PATTERN_ALPHANUM .sub ("" , unique ).upper (),
229222 "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 ),
232225 "uuid" : generate_uuid (freezed_time ),
233226 }
234227
@@ -512,7 +505,7 @@ def build_param(p):
512505 json .loads (Template (p ["value" ]).render (** context )),
513506 )
514507 return open (filepath )
515- return json . loads (Template (p ["value" ]).render (** context ))
508+ return client . deserialize (Template (p ["value" ]).render (** context ), openapi_types , True )
516509 if "source" in p :
517510 return glom (context , p ["source" ])
518511
0 commit comments