              "Code: %r\nLine: %s\nException: %s" % (example.source.strip(), example.lineno, tb))
  
  class DjangoDoctestOutputChecker(doctest.OutputChecker):
      def check_output(self, want, got, optionflags):
          ok = doctest.OutputChecker.check_output(self, want, got, optionflags)
  
          # Doctest does an exact string comparison of output, which means long
          # integers aren't equal to normal integers ("22L" vs. "22"). The
 
</s> remove         if not ok and (want.strip().endswith("L") or got.strip().endswith("L")):
            try:
                return long(want.strip()) == long(got.strip())
            except ValueError:
                return False
 </s> add         # Doctest does an exact string comparison of output, which means long
        # integers aren't equal to normal integers ("22L" vs. "22"). The
        # following code normalizes long integers so that they equal normal
        # integers.
        if not ok:
            return normalize_long_ints(want) == normalize_long_ints(got) </s> remove import os, sys, time, traceback
 </s> add import os, re, sys, time, traceback
normalize_long_ints = lambda s: re.sub(r'(?<![\w])(\d+)L(?![\w])', '\\1', s)

              "Code: %r\nLine: %s\nException: %s" % (example.source.strip(), example.lineno, tb))
  
normalize_long_ints = lambda s: re.sub(r'(?<![\w])(\d+)L(?![\w])', '\\1', s)

  class DjangoDoctestOutputChecker(doctest.OutputChecker):
      def check_output(self, want, got, optionflags):
          ok = doctest.OutputChecker.check_output(self, want, got, optionflags)
  
          # Doctest does an exact string comparison of output, which means long
          # integers aren't equal to normal integers ("22L" vs. "22"). The
keep add keep keep keep keep keep keep
 Improved doctests to normalize long integers in compared output

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2034 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
tests/runtests.py