formlib test fails

Bug #143930 reported by Maurits van Rees on 2007-06-22
2
Affects Status Importance Assigned to Milestone
zope.formlib
Fix Released
Medium
Unassigned

Bug Description

I ran the tests of the Zope 2.9 and 2.10 branches (with 'make test') and ran into one failure both times. It it possible that the test passes for others as it may have to do with some i18n/l10n settings.

  File "/home/maurits/tmp/Zope-2.9.7-final/lib/python/zope/formlib/form.txt", line 796, in form.txt
  Failed example:
      print MyForm(order, request)()
      # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
  Expected:
      There were errors:
      (u'Invalid floating point data', <exceptions.ValueError instance at ...>)
      1
      <input class="textType" id="form.name" name="form.name" size="20"
             type="text" value="bob" />
      <input class="textType" id="form.min_size" name="form.min_size" size="10"
             type="text" value="42.0" />
      <input class="textType" id="form.max_size" name="form.max_size" size="10"
             type="text" value="10,0" />
      <span class="error">Invalid floating point data</span>
      <input type="submit" id="form.actions.edit" name="form.actions.edit"
             value="Edit" class="button" />
  Got:
      There were errors:
      Maximum is less than Minimum
      1
      <input class="textType" id="form.name" name="form.name" size="20" type="text" value="bob" />
      <input class="textType" id="form.min_size" name="form.min_size" size="10" type="text" value="42.0" />
      <input class="textType" id="form.max_size" name="form.max_size" size="10" type="text" value="10.0" />
      <input type="submit" id="form.actions.edit" name="form.actions.edit" value="Edit" class="button" />

What goes wrong here is that the supposedly wrong test input of "10,0" is converted to "10.0", at least on my computer and as I am Dutch I think that is fine, so the expected error of 'Invalid floating point data' never happens. Instead another error shows, but that one is actually taken care of in the next test.

Conclusion: the "wrong" test input of "10,0" is not actually wrong, at least not on all computers. So: I suggest this is changed into some other wrong input. In the attached diff I pick "10/0" as test input, as the '/' is next to the '.' on my keyboard. With that fix all tests pass again.

Bug in zope.formlib

Changed in zope2:
status: New → Confirmed
affects: zope2 → zope.formlib
Albertas Agejevas (alga) wrote :

Cannot reproduce by running the test with the Dutch locale like this:
LC_ALL=nl_NL.UTF-8 bin/test -s zope.formlib -t form

Albertas Agejevas (alga) wrote :

Fix commited in rev 113530.

Changed in zope.formlib:
status: Confirmed → Fix Committed
Changed in zope.formlib:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments