예제 #1
0
    def test_do_date(self):
        now = date(2010, 11, 11)
        date_filter = fil.do_date(now)
        self.assertEqual('2010-11-11 - Thursday', date_filter)
        self.assertNotEqual('2010-11-12 - Thursday', date_filter)

        date_filter2 = fil.do_date(None)
        self.assertEqual('', date_filter2)
    def test_do_date(self):
        now = date(2010, 11, 11)
        date_filter = fil.do_date(now)
        self.assertEqual('2010-11-11 - Thursday', date_filter)
        self.assertNotEqual('2010-11-12 - Thursday', date_filter)

        date_filter2 = fil.do_date(None)
        self.assertEqual('', date_filter2)
예제 #3
0
 def test_do_date(self):
     # Without a datetime
     result_date = filters.do_date(None)
     self.assertEqual('', result_date)
     # With datetime and without a date format
     result_date = filters.do_date(datetime(2014, 4, 10, 13, 11, 35))
     self.assertEqual('2014-04-10 - Thursday', result_date)
     # With datetime and a date format
     result_date = filters.do_date(datetime(2014, 4, 10, 13, 11, 35), '%d-%m %H:%M:%S')
     self.assertEqual('10-04 13:11:35', result_date)
     self.assertNotEqual('2014-04-10 - Thursday', result_date)
예제 #4
0
 def testDo_date(self):
     fecha = filters.do_date(datetime(1990, 07, 01, 07, 06, 00))
     self.assertEqual(fecha, '1990-07-01 - Sunday')
     self.assertNotEqual(fecha, '1990-07-01 - Sunday at 7:06am')
예제 #5
0
 def testDo_dateNone(self):
     fecha = filters.do_date(None)
     self.assertEqual(fecha, '')
예제 #6
0
 def test_date_not_none(self):
     now = datetime(2010, 11, 11, 13, 00, 00)
     fechadate = filters.do_date(now)
     self.assertNotEqual(fechadate, '2010-11-11 - Thursday at 1:00pm')
     self.assertEqual(fechadate, '2010-11-11 - Thursday')
예제 #7
0
 def test_date_none(self):
     fechadate = filters.do_date(None)
     self.assertEqual(fechadate, '')
예제 #8
0
 def testDateNotEmpty(self):
     date = datetime(2014, 1, 23, 9, 00, 00)
     result = filters.do_date(date)
     self.assertEqual(result, '2014-01-23 - Thursday')
예제 #9
0
 def testDateEmpty(self):
     result = filters.do_date(None)
     self.assertEqual(result, '')
예제 #10
0
 def test_date_not_none(self):
     now = datetime(2010, 11, 11, 13, 00, 00)
     fechadate = filters.do_date(now)
     self.assertNotEqual(fechadate, '2010-11-11 - Thursday at 1:00pm')
     self.assertEqual(fechadate, '2010-11-11 - Thursday')
예제 #11
0
 def test_date_none(self):
     fechadate = filters.do_date(None)
     self.assertEqual(fechadate, '')
예제 #12
0
 def testDateNotEmpty(self):
     date = datetime(2014, 1, 23, 9, 00, 00)
     result = filters.do_date(date)
     self.assertEqual(result, '2014-01-23 - Thursday')
예제 #13
0
 def testDateEmpty(self):
     result = filters.do_date(None)
     self.assertEqual(result, '')