예제 #1
0
 def test_value_error(self, Locale):
     """
     If Locale.parse raises a ValueError, return the en-US locale
     object.
     """
     Locale.parse.side_effect = ValueError
     assert helpers.current_locale() == Locale.return_value
     Locale.assert_called_with('en', 'US')
예제 #2
0
 def test_value_error(self, Locale):
     """
     If Locale.parse raises a ValueError, return the en-US locale
     object.
     """
     Locale.parse.side_effect = ValueError
     eq_(helpers.current_locale(), Locale.return_value)
     Locale.assert_called_with('en', 'US')
예제 #3
0
 def test_unknown_locale(self, Locale):
     """
     If Locale.parse raises an UnknownLocaleError, return the en-US
     locale object.
     """
     Locale.parse.side_effect = UnknownLocaleError('foo')
     assert helpers.current_locale() == Locale.return_value
     Locale.assert_called_with('en', 'US')
예제 #4
0
 def test_unknown_locale(self, Locale):
     """
     If Locale.parse raises an UnknownLocaleError, return the en-US
     locale object.
     """
     Locale.parse.side_effect = UnknownLocaleError('foo')
     eq_(helpers.current_locale(), Locale.return_value)
     Locale.assert_called_with('en', 'US')