MCPcopy
hub / github.com/django/django / test_lazy_mul_str

Method test_lazy_mul_str

tests/utils_tests/test_functional.py:236–241  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

234 self.assertEqual(lazy_4() * lazy_5(), [4, 4, 4, 4, 4])
235
236 def test_lazy_mul_str(self):
237 lazy_a = lazy(lambda: "a", str)
238 lazy_5 = lazy(lambda: 5, int)
239 self.assertEqual("a" * lazy_5(), "aaaaa")
240 self.assertEqual(lazy_a() * 5, "aaaaa")
241 self.assertEqual(lazy_a() * lazy_5(), "aaaaa")
242
243 def test_lazy_format(self):
244 class QuotedString(str):

Callers

nothing calls this directly

Calls 1

lazyFunction · 0.90

Tested by

no test coverage detected