22
33from dataclasses import dataclass
44from decimal import Decimal
5+ from .generic_utils import format_future_dates
56from datetime import datetime , timedelta
6- import random
77
88
99# Lists of data types for 'invalid data type' testing
@@ -294,15 +294,20 @@ class InvalidValues:
294294 "2000-02-30" , # Invalid combination of month and day
295295 ]
296296
297- for_future_dates = [
298- (datetime .now () + timedelta (days = random .randint (1 , 30 ))).strftime ("%Y-%m-%d" )
299- for i in range (3 )
297+ now = datetime .now ()
298+ sample_inputs = [
299+ now + timedelta (days = 1 ),
300+ now + timedelta (days = 365 ),
301+ now + timedelta (days = 730 )
300302 ]
301303
304+ for_future_dates = format_future_dates (sample_inputs , mode = "date" )
305+
302306 # Strings which are not in acceptable date time format
303307 for_date_time_string_formats_for_relaxed_timezone = [
304308 "" , # Empty string
305309 "invalid" , # Invalid format
310+ * format_future_dates (sample_inputs , mode = "datetime" ),
306311 "20000101" , # Date digits only (i.e. without hypens)
307312 "20000101000000" , # Date and time digits only
308313 "200001010000000000" , # Date, time and timezone digits only
@@ -394,4 +399,3 @@ class InvalidValues:
394399 ]
395400
396401 invalid_dose_quantity = {"value" : 2 , "unit" : "ml" , "code" : "258773002" }
397-
0 commit comments