コード例 #1
0
 def test_format_builtin(self):
     """
     Test that there exist built-in formats. We're not interested in
     testing "all" of them, just that the capability exists.
     """
     with self.settings(TIME_ZONE='UTC'):
         datetime = aware_datetime(2015, 1, 1, 5, 7)
     assert_equal(format_datetime(datetime, 'time'), '05:07 UTC')
コード例 #2
0
def test_helper_base_format_dt_builtin(settings):
    """
    Test that there exist built-in formats. We're not interested in
    testing "all" of them, just that the capability exists.
    """
    settings.TIME_ZONE = 'UTC'
    datetime = aware_datetime(2015, 1, 1, 5, 7)
    assert format_datetime(datetime, 'time') == '05:07 UTC'
コード例 #3
0
ファイル: test_helpers.py プロジェクト: mathjazz/pontoon
def test_helper_base_format_dt_builtin(settings):
    """
    Test that there exist built-in formats. We're not interested in
    testing "all" of them, just that the capability exists.
    """
    settings.TIME_ZONE = 'UTC'
    datetime = aware_datetime(2015, 1, 1, 5, 7)
    assert format_datetime(datetime, 'time') == '05:07 UTC'
コード例 #4
0
ファイル: test_helpers.py プロジェクト: MekliCZ/pontoon
 def test_format_builtin(self):
     """
     Test that there exist built-in formats. We're not interested in
     testing "all" of them, just that the capability exists.
     """
     with self.settings(TIME_ZONE='UTC'):
         datetime = aware_datetime(2015, 1, 1, 5, 7)
     assert_equal(format_datetime(datetime, 'time'), '05:07 UTC')
コード例 #5
0
def test_helper_base_format_dt_custom():
    datetime = aware_datetime(2015, 1, 1, 5, 7)
    assert format_datetime(datetime, '%H:%M') == '05:07'
コード例 #6
0
def test_helper_base_format_dt_none():
    assert format_datetime(None) == '---'
コード例 #7
0
 def test_format_datetime_custom(self):
     datetime = aware_datetime(2015, 1, 1, 5, 7)
     assert_equal(format_datetime(datetime, '%H:%M'), '05:07')
コード例 #8
0
 def test_format_datetime_none(self):
     assert_equal(format_datetime(None), '---')
コード例 #9
0
ファイル: test_helpers.py プロジェクト: MekliCZ/pontoon
 def test_format_datetime_custom(self):
     datetime = aware_datetime(2015, 1, 1, 5, 7)
     assert_equal(format_datetime(datetime, '%H:%M'), '05:07')
コード例 #10
0
ファイル: test_helpers.py プロジェクト: MekliCZ/pontoon
 def test_format_datetime_none(self):
     assert_equal(format_datetime(None), '---')
コード例 #11
0
ファイル: test_helpers.py プロジェクト: mathjazz/pontoon
def test_helper_base_format_dt_custom():
    datetime = aware_datetime(2015, 1, 1, 5, 7)
    assert format_datetime(datetime, '%H:%M') == '05:07'
コード例 #12
0
ファイル: test_helpers.py プロジェクト: mathjazz/pontoon
def test_helper_base_format_dt_none():
    assert format_datetime(None) == '---'
コード例 #13
0
ファイル: test_helpers.py プロジェクト: dsaumyajit007/pontoon
 def test_format_datetime_custom(self):
     datetime = aware_datetime(2015, 1, 1, 5, 7)
     assert_equal(format_datetime(datetime, "%H:%M"), "05:07")