コード例 #1
0
    def test_time_tag_future(self):
        date = datetime.datetime(2000, 1, 2, 3, 4, 5)
        output = time_tag(date, future=True)

        expected = '<time datetime="{}" class="in">{}</time>'.format(
            date.isoformat(), date.strftime("%a, %b %d, %Y at %H:%M %Z"))
        assert output == expected
コード例 #2
0
    def test_time_tag_future(self):
        date = datetime.datetime(2000, 1, 2, 3, 4, 5)
        output = time_tag(date, future=True)

        eq_(
            output, '<time datetime="{}" class="in">{}</time>'.format(
                date.isoformat(), date.strftime('%a, %b %d %H:%M %Z')))
コード例 #3
0
    def test_time_tag_with_date(self):
        date = datetime.date(2000, 1, 2)
        output = time_tag(date)

        expected = '<time datetime="{}" class="ago">{}</time>'.format(
            date.isoformat(), date.strftime("%a, %b %d, %Y at %H:%M %Z"))
        assert output == expected
コード例 #4
0
    def test_time_tag_with_date(self):
        date = datetime.date(2000, 1, 2)
        output = time_tag(date)

        eq_(
            output, '<time datetime="{}" class="ago">{}</time>'.format(
                date.isoformat(), date.strftime('%a, %b %d %H:%M %Z')))
コード例 #5
0
ファイル: test_jinja_helpers.py プロジェクト: richev/socorro
    def test_parse_with_unicode_with_timezone(self):
        # See https://bugzilla.mozilla.org/show_bug.cgi?id=1300921
        date = "2016-09-07T00:38:42.630775+00:00"
        output = time_tag(date)

        expected = '<time datetime="{}" class="ago">{}</time>'.format(
            "2016-09-07T00:38:42.630775+00:00", "Wed, Sep 07 00:38 +00:00")
        assert output == expected
コード例 #6
0
ファイル: test_jinja_helpers.py プロジェクト: adngdb/socorro
    def test_time_tag_future(self):
        date = datetime.datetime(2000, 1, 2, 3, 4, 5)
        output = time_tag(date, future=True)

        eq_(output, '<time datetime="{}" class="in">{}</time>'.format(
            date.isoformat(),
            date.strftime('%a, %b %d %H:%M %Z')
        ))
コード例 #7
0
ファイル: test_jinja_helpers.py プロジェクト: adngdb/socorro
    def test_time_tag_with_date(self):
        date = datetime.date(2000, 1, 2)
        output = time_tag(date)

        eq_(output, '<time datetime="{}" class="ago">{}</time>'.format(
            date.isoformat(),
            date.strftime('%a, %b %d %H:%M %Z')
        ))
コード例 #8
0
    def test_parse_with_unicode_with_timezone(self):
        # See https://bugzilla.mozilla.org/show_bug.cgi?id=1300921
        date = u'2016-09-07T00:38:42.630775+00:00'
        output = time_tag(date)

        eq_(
            output, '<time datetime="{}" class="ago">{}</time>'.format(
                '2016-09-07T00:38:42.630775+00:00',
                'Wed, Sep 07 00:38 +00:00'))
コード例 #9
0
ファイル: test_jinja_helpers.py プロジェクト: adngdb/socorro
    def test_parse_with_unicode_with_timezone(self):
        # See https://bugzilla.mozilla.org/show_bug.cgi?id=1300921
        date = u'2016-09-07T00:38:42.630775+00:00'
        output = time_tag(date)

        eq_(output, '<time datetime="{}" class="ago">{}</time>'.format(
            '2016-09-07T00:38:42.630775+00:00',
            'Wed, Sep 07 00:38 +00:00'
        ))
コード例 #10
0
    def test_time_tag_with_datetime(self):
        date = datetime.datetime(2000, 1, 2, 3, 4, 5)
        output = time_tag(date)

        expected = '<time datetime="{}" class="ago">{}</time>'.format(
            date.isoformat(),
            date.strftime('%a, %b %d %H:%M %Z')
        )
        assert output == expected
コード例 #11
0
 def test_time_tag_invalid_date(self):
     output = time_tag("junk")
     assert output == "junk"
コード例 #12
0
ファイル: test_jinja_helpers.py プロジェクト: maxsd32/socorro
 def test_time_tag_invalid_date(self):
     output = time_tag('junk')
     assert output == 'junk'
コード例 #13
0
 def test_time_tag_invalid_date(self):
     output = time_tag('junk')
     eq_(output, 'junk')
コード例 #14
0
ファイル: test_jinja_helpers.py プロジェクト: adngdb/socorro
 def test_time_tag_invalid_date(self):
     output = time_tag('junk')
     eq_(output, 'junk')
コード例 #15
0
 def test_time_tag_invalid_date(self):
     output = time_tag('junk')
     assert output == 'junk'