Commits

Ralph Bean  committed 4375b4d

Make date tests pass by (duh) actually using today's date.

  • Participants
  • Parent commits 2e3deed

Comments (0)

Files changed (1)

File tests/test_widget.py

 import tw2.forms as twf
 import tw2.bootstrap as twb
 
+import datetime
+
 
 def test_every_widget_exposed():
     """ Is widget exposed by tw2.forms also in tw2.bootstrap? """
     widget = twb.CalendarDatePicker
     expected = """
     <input name="bootstrap-test" type="text" id="bootstrap-test"
-           class="input-medium" value="05/29/2012" data-date="05/29/2012"
+           class="input-medium" value="{today}" data-date="{today}"
            data-date-format="mm/dd/yyyy" />
-    """
+    """.format(today=datetime.datetime.now().strftime("%m/%d/%Y"))
 
 
 class TestCalendarTimePicker(WidgetTest):
     expected = """
     <div id="bootstrap-test">
        <input name="bootstrap-test:date" type="text" id="bootstrap-test:date"
-              class="input-medium" value="05/29/2012" data-date="05/29/2012"
+              class="input-medium" value="{today}" data-date="{today}"
               data-date-format="mm/dd/yyyy" />
        <input name="bootstrap-test:time" type="text"
               id="bootstrap-test:time" class="input-medium"/>
     </div>
-    """
+    """.format(today=datetime.datetime.now().strftime("%m/%d/%Y"))