Removed obsolete django.test.utils.strip_quotes().

Django's test runners no longer discover doctests.
This commit is contained in:
Tim Graham 2017-04-27 20:32:12 -04:00 committed by GitHub
parent e62ea0bb9c
commit 60dce33ab1
1 changed files with 0 additions and 20 deletions

View File

@ -557,7 +557,6 @@ def compare_xml(want, got):
if node.nodeType != Node.COMMENT_NODE:
return node
want, got = strip_quotes(want, got)
want = want.strip().replace('\\n', '\n')
got = got.strip().replace('\\n', '\n')
@ -575,25 +574,6 @@ def compare_xml(want, got):
return check_element(want_root, got_root)
def strip_quotes(want, got):
"""
Strip quotes of doctests output values:
>>> strip_quotes("'foo'")
"foo"
>>> strip_quotes('"foo"')
"foo"
"""
def is_quoted_string(s):
s = s.strip()
return len(s) >= 2 and s[0] == s[-1] and s[0] in ('"', "'")
if is_quoted_string(want) and is_quoted_string(got):
want = want.strip()[1:-1]
got = got.strip()[1:-1]
return want, got
def str_prefix(s):
return s % {'_': ''}