File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -302,7 +302,7 @@ def validate_date_format(
302302 # We expect that more formats than this will be accepted.
303303 # These are the accepted ones we know of at the time of writing.
304304 known_accepted_formats = {
305- 'X'
305+ '%a, %d %b %Y %H:%M:%S GMT' ,
306306 }
307307
308308 try :
Original file line number Diff line number Diff line change @@ -1621,17 +1621,25 @@ class TestDateFormats:
16211621 """
16221622
16231623 @pytest .mark .parametrize ('datetime_format' , [
1624+ '%a, %b %d %H:%M:%S %Y' ,
16241625 '%a %b %d %H:%M:%S %Y' ,
1626+ '%a, %d %b %Y %H:%M:%S' ,
1627+ '%a %d %b %Y %H:%M:%S' ,
16251628 ])
1629+ @pytest .mark .parametrize ('include_tz' , [True , False ])
16261630 def test_date_formats (
16271631 self ,
16281632 high_quality_image : io .BytesIO ,
16291633 vuforia_database_keys : VuforiaDatabaseKeys ,
16301634 datetime_format : str ,
1635+ include_tz : bool ,
16311636 ) -> None :
16321637 image_content = high_quality_image .getvalue ()
16331638 body = {'image' : ('image.jpeg' , image_content , 'image/jpeg' )}
16341639
1640+ if include_tz :
1641+ datetime_format += ' GMT'
1642+
16351643 gmt = pytz .timezone ('GMT' )
16361644 now = datetime .datetime .now (tz = gmt )
16371645 date = now .strftime (datetime_format )
You can’t perform that action at this time.
0 commit comments