@@ -45,7 +45,7 @@ def test_disallow_nonexistant_options(self):
4545 fluent_number ,
4646 1 ,
4747 not_a_real_option = True ,
48- )
48+ )
4949
5050 def test_style_validation (self ):
5151 self .assertRaises (ValueError ,
@@ -213,14 +213,14 @@ def test_timeStyle_datetime(self):
213213 fd = fluent_date (self .a_datetime , timeStyle = 'short' )
214214 en_US = Locale .parse ('en_US' )
215215 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$ ' )
217217 self .assertEqual (fd .format (en_GB ), '14:15' )
218218
219219 def test_dateStyle_and_timeStyle_datetime (self ):
220220 fd = fluent_date (self .a_datetime , timeStyle = 'short' , dateStyle = 'short' )
221221 en_US = Locale .parse ('en_US' )
222222 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$ ' )
224224 self .assertEqual (fd .format (en_GB ), '01/02/2018, 14:15' )
225225
226226 def test_validate_dateStyle (self ):
@@ -246,7 +246,7 @@ def test_timeZone(self):
246246 fd1 = fluent_date (dt1 , dateStyle = 'short' , timeStyle = 'short' )
247247 self .assertEqual (fd1 .format (en_GB ), '02/07/2018, 00:30' )
248248 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$ ' )
250250 fd1c = fluent_date (dt1 , dateStyle = 'short' )
251251 self .assertEqual (fd1c .format (en_GB ), '02/07/2018' )
252252 fd1d = fluent_date (dt1 , timeStyle = 'short' )
@@ -290,7 +290,7 @@ def test_disallow_nonexistant_options(self):
290290 fluent_date ,
291291 self .a_date ,
292292 not_a_real_option = True ,
293- )
293+ )
294294
295295 def test_dont_wrap_unnecessarily (self ):
296296 f1 = fluent_date (self .a_date )
0 commit comments