@@ -45,7 +45,7 @@ def test_disallow_nonexistant_options(self):
45
45
fluent_number ,
46
46
1 ,
47
47
not_a_real_option = True ,
48
- )
48
+ )
49
49
50
50
def test_style_validation (self ):
51
51
self .assertRaises (ValueError ,
@@ -213,14 +213,14 @@ def test_timeStyle_datetime(self):
213
213
fd = fluent_date (self .a_datetime , timeStyle = 'short' )
214
214
en_US = Locale .parse ('en_US' )
215
215
en_GB = Locale .parse ('en_GB' )
216
- self .assertEqual (fd .format (en_US ), '2:15 PM ' )
216
+ self .assertRegex (fd .format (en_US ), '^ 2:15\\ sPM$ ' )
217
217
self .assertEqual (fd .format (en_GB ), '14:15' )
218
218
219
219
def test_dateStyle_and_timeStyle_datetime (self ):
220
220
fd = fluent_date (self .a_datetime , timeStyle = 'short' , dateStyle = 'short' )
221
221
en_US = Locale .parse ('en_US' )
222
222
en_GB = Locale .parse ('en_GB' )
223
- self .assertEqual (fd .format (en_US ), '2/1/18, 2:15 PM ' )
223
+ self .assertRegex (fd .format (en_US ), '^ 2/1/18, 2:15\\ sPM$ ' )
224
224
self .assertEqual (fd .format (en_GB ), '01/02/2018, 14:15' )
225
225
226
226
def test_validate_dateStyle (self ):
@@ -246,7 +246,7 @@ def test_timeZone(self):
246
246
fd1 = fluent_date (dt1 , dateStyle = 'short' , timeStyle = 'short' )
247
247
self .assertEqual (fd1 .format (en_GB ), '02/07/2018, 00:30' )
248
248
fd1b = fluent_date (dt1 , dateStyle = 'full' , timeStyle = 'full' )
249
- self .assertEqual (fd1b .format (en_GB ), 'Monday, 2 July 2018 at 00:30:00 British Summer Time' )
249
+ self .assertRegex (fd1b .format (en_GB ), '^ Monday, 2 July 2018(,| at) 00:30:00 British Summer Time$ ' )
250
250
fd1c = fluent_date (dt1 , dateStyle = 'short' )
251
251
self .assertEqual (fd1c .format (en_GB ), '02/07/2018' )
252
252
fd1d = fluent_date (dt1 , timeStyle = 'short' )
@@ -259,7 +259,7 @@ def test_timeZone(self):
259
259
self .assertEqual (fd2 .format (en_GB ), '02/07/2018, 00:30' )
260
260
fd2b = fluent_date (dt2 , dateStyle = 'full' , timeStyle = 'full' ,
261
261
timeZone = 'Europe/London' )
262
- self .assertEqual (fd2b .format (en_GB ), 'Monday, 2 July 2018 at 00:30:00 British Summer Time' )
262
+ self .assertRegex (fd2b .format (en_GB ), '^ Monday, 2 July 2018(,| at) 00:30:00 British Summer Time$ ' )
263
263
fd2c = fluent_date (dt2 , dateStyle = 'short' ,
264
264
timeZone = 'Europe/London' )
265
265
self .assertEqual (fd2c .format (en_GB ), '02/07/2018' )
@@ -290,7 +290,7 @@ def test_disallow_nonexistant_options(self):
290
290
fluent_date ,
291
291
self .a_date ,
292
292
not_a_real_option = True ,
293
- )
293
+ )
294
294
295
295
def test_dont_wrap_unnecessarily (self ):
296
296
f1 = fluent_date (self .a_date )
0 commit comments