Hello Karen,

another issue. If I'm using unicode characters in model's doctest:

    u"""
    >>> osoba = Osoba(meno = u"Ľudmila", priezvisko = u"Šafářová")
    >>> osoba.save()
    >>> subjekt = Subjekt(nazov = u"Žaba s.r.o.", osoba = osoba)
    >>> subjekt.save()
    >>> subjekt = Subjekt.objects.get(id = subjekt.id)
    >>> subjekt
    <Subjekt: Žaba s.r.o. - Šafářová Ľudmila>
    """
the test ends this way:

....................................../Library/Python/2.5/site-
packages/django/test/_doctest.py:1502: UnicodeWarning: Unicode equal
comparison failed to convert both arguments to Unicode - interpreting
them as being unequal
  if got == want:
/Library/Python/2.5/site-packages/django/test/_doctest.py:1522:
UnicodeWarning: Unicode equal comparison failed to convert both
arguments to Unicode - interpreting them as being unequal
  if got == want:
/Library/Python/2.5/site-packages/django/test/_doctest.py:299:
UnicodeWarning: Unicode equal comparison failed to convert both
arguments to Unicode - interpreting them as being unequal
  return want == got
E.
======================================================================
ERROR: Doctest: konres.subjekty.models.Subjekt
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Python/2.5/site-packages/django/test/_doctest.py",
line 2175, in runTest
    test, out=new.write, clear_globs=False)
  File "/Library/Python/2.5/site-packages/django/test/_doctest.py",
line 1403, in run
    return self.__run(test, compileflags, out)
  File "/Library/Python/2.5/site-packages/django/test/_doctest.py",
line 1316, in __run
    self.report_failure(out, test, example, got)
  File "/Library/Python/2.5/site-packages/django/test/_doctest.py",
line 1184, in report_failure
    self._checker.output_difference(example, got, self.optionflags))
  File "/Library/Python/2.5/site-packages/django/test/_doctest.py",
line 1607, in output_difference
    return 'Expected:\n%sGot:\n%s' % (_indent(want), _indent(got))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position
14: ordinal not in range(128)

Is it possible to use unicode chars in doctests?

Can you help me pls? Doctest is so nice for join documentation and
test it will be a pitty to leave them out.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to