Esempio n. 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')
Esempio n. 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'
Esempio n. 3
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'
Esempio n. 4
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')
Esempio n. 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'
Esempio n. 6
0
def test_helper_base_format_dt_none():
    assert format_datetime(None) == '---'
Esempio n. 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')
Esempio n. 8
0
 def test_format_datetime_none(self):
     assert_equal(format_datetime(None), '---')
Esempio n. 9
0
 def test_format_datetime_custom(self):
     datetime = aware_datetime(2015, 1, 1, 5, 7)
     assert_equal(format_datetime(datetime, '%H:%M'), '05:07')
Esempio n. 10
0
 def test_format_datetime_none(self):
     assert_equal(format_datetime(None), '---')
Esempio n. 11
0
def test_helper_base_format_dt_custom():
    datetime = aware_datetime(2015, 1, 1, 5, 7)
    assert format_datetime(datetime, '%H:%M') == '05:07'
Esempio n. 12
0
def test_helper_base_format_dt_none():
    assert format_datetime(None) == '---'
Esempio n. 13
0
 def test_format_datetime_custom(self):
     datetime = aware_datetime(2015, 1, 1, 5, 7)
     assert_equal(format_datetime(datetime, "%H:%M"), "05:07")