mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Refs #32508 -- Raised ValueError instead of using "assert" in lazy().
This commit is contained in:
parent
2cd0ccef04
commit
775b796d8d
2 changed files with 10 additions and 2 deletions
|
@ -224,6 +224,12 @@ class FunctionalTests(SimpleTestCase):
|
|||
lazified()
|
||||
mocked.assert_not_called()
|
||||
|
||||
def test_lazy_bytes_and_str_result_classes(self):
|
||||
lazy_obj = lazy(lambda: 'test', str, bytes)
|
||||
msg = 'Cannot call lazy() with both bytes and text return types.'
|
||||
with self.assertRaisesMessage(ValueError, msg):
|
||||
lazy_obj()
|
||||
|
||||
def test_classproperty_getter(self):
|
||||
class Foo:
|
||||
foo_attr = 123
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue