#NEWLINE# @ any_form_field . register ( forms . DateTimeField ) #NEWLINE# def datetime_field_data( field , **kwargs ) : #NEWLINE# #INDENT# "\n    Return random value for DateTimeField\n\n    >>> result = any_form_field(forms.DateTimeField())\n    >>> type(result)\n    <type 'str'>\n    " #NEWLINE# from_date = kwargs . get ( 'from_date' , datetime ( 1990 , 1 , 1 ) ) #NEWLINE# to_date = kwargs . get ( 'to_date' , datetime . today ( ) ) #NEWLINE# date_format = random . choice ( ( field . input_formats or formats . get_format ( 'DATETIME_INPUT_FORMATS' ) ) ) #NEWLINE# return xunit . any_datetime ( from_date = from_date , to_date = to_date ) . strftime ( field )