File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,26 @@ def month_string_to_number(self, string: str) -> int:
127127 raise ValueError ("Not a month" )
128128
129129 def generate_unique_weekday_date (self , start_year : int = 2025 ) -> str :
130+ """
131+ Generates a future weekday date from the specified year onward.
132+
133+ This function returns a dynamically generated date string in the format 'dd/mm/yyyy'
134+ that always falls on a weekday (Monday–Friday) and is suitable for use in automated tests
135+ where the date must differ on each run to avoid duplication issues.
136+
137+ A small pseudorandom offset is added to ensure uniqueness between runs.
138+
139+ Note:
140+ This function uses Python's built-in `random` module to add variability.
141+ Since this is for test-only purposes and does not involve security-sensitive logic,
142+ the use of a non-cryptographic PRNG is appropriate and intentional.
143+
144+ Args:
145+ start_year (int): The minimum year from which the date may be generated. Defaults to 2025.
146+
147+ Returns:
148+ str: A future weekday date in the format 'dd/mm/yyyy'.
149+ """
130150 # Start from tomorrow to ensure future date
131151 base_date = datetime .now () + timedelta (days = 1 )
132152
You can’t perform that action at this time.
0 commit comments