Exemplo 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')
Exemplo 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'
Exemplo 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'
Exemplo 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')
Exemplo 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'
Exemplo n.º 6
0
def test_helper_base_format_dt_none():
    assert format_datetime(None) == '---'
Exemplo 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')
Exemplo n.º 8
0
 def test_format_datetime_none(self):
     assert_equal(format_datetime(None), '---')
Exemplo 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')
Exemplo n.º 10
0
 def test_format_datetime_none(self):
     assert_equal(format_datetime(None), '---')
Exemplo 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'
Exemplo n.º 12
0
def test_helper_base_format_dt_none():
    assert format_datetime(None) == '---'
Exemplo 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")