MCPcopy
hub / github.com/django/django / QuotedString

Class QuotedString

tests/utils_tests/test_functional.py:244–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242
243 def test_lazy_format(self):
244 class QuotedString(str):
245 def __format__(self, format_spec):
246 value = super().__format__(format_spec)
247 return f"“{value}”"
248
249 lazy_f = lazy(lambda: QuotedString("Hello!"), QuotedString)
250 self.assertEqual(format(lazy_f(), ""), "“Hello!”")

Callers 1

test_lazy_formatMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_lazy_formatMethod · 0.68