Comment 0 for bug 143930

Revision history for this message
Maurits van Rees (mauritsvanrees) wrote :

Uploaded: formlibtest.txt

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.