MCPcopy
hub / github.com/django/django / test_unescape_string_literal

Method test_unescape_string_literal

tests/utils_tests/test_text.py:376–386  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

374 self.assertEqual(sys.intern(text.slugify("a")), "a")
375
376 def test_unescape_string_literal(self):
377 items = [
378 ('"abc"', "abc"),
379 ("'abc'", "abc"),
380 ('"a "bc""', 'a "bc"'),
381 ("''ab' c'", "'ab' c"),
382 ]
383 for value, output in items:
384 with self.subTest(value=value):
385 self.assertEqual(text.unescape_string_literal(value), output)
386 self.assertEqual(text.unescape_string_literal(lazystr(value)), output)
387
388 def test_unescape_string_literal_invalid_value(self):
389 items = ["", "abc", "'abc\""]

Callers

nothing calls this directly

Calls 1

lazystrFunction · 0.90

Tested by

no test coverage detected