コード例 #1
0
 def test_apply_timezone_from_settings_function(self, date, timezone,
                                                expected):
     result = apply_timezone_from_settings(
         date,
         settings.replace(**{
             'TO_TIMEZONE': timezone,
             'TIMEZONE': 'UTC'
         }))
     self.assertEqual(expected, result)
コード例 #2
0
    def given_configurations(self, confs):
        if 'TIMEZONE' not in confs:
            confs.update({'TIMEZONE': 'local'})

        self.confs = settings.replace(**confs)
コード例 #3
0
 def test_apply_timezone_from_settings_function_should_return_tz(
         self, date):
     result = apply_timezone_from_settings(
         date, settings.replace(**{'RETURN_AS_TIMEZONE_AWARE': True}))
     self.assertTrue(bool(result.tzinfo))
コード例 #4
0
ファイル: test_utils.py プロジェクト: scrapinghub/dateparser
 def test_apply_timezone_from_settings_function_should_return_tz(self, date):
     result = apply_timezone_from_settings(date, settings.replace(**{'RETURN_AS_TIMEZONE_AWARE': True}))
     self.assertTrue(bool(result.tzinfo))
コード例 #5
0
ファイル: test_utils.py プロジェクト: scrapinghub/dateparser
 def test_apply_timezone_from_settings_function(self, date, timezone, expected):
     result = apply_timezone_from_settings(date, settings.replace(**{'TO_TIMEZONE': timezone, 'TIMEZONE': 'UTC'}))
     self.assertEqual(expected, result)