Пример #1
0
    def test_calendarWidget_img(self):
        img = settings.SITE_MEDIA_PREFIX + 'img/icon_calendar.gif'
        w = CalendarWidget(attrs={
            'img': img,
        })
        self.assertEqual(w.render('mydate', '1940-10-09'),
            """<img class="calendar" src="{0}" alt="Calendar">\
<input value="1940-10-09" type="text" class="vDateField" \
name="mydate" size="10" />""".format(img))
Пример #2
0
    def test_calendarWidget(self):
        w = CalendarWidget()
        self.assertEqual(w.render('mydate', '1940-10-09'),
            """<input value="1940-10-09" type="text" class="vDateField" \
name="mydate" size="10" />""")