(self)
| 255 | |
| 256 | class TestUndefined: |
| 257 | def test_stopiteration_is_undefined(self): |
| 258 | def test(): |
| 259 | raise StopIteration() |
| 260 | |
| 261 | t = Template("A{{ test() }}B") |
| 262 | assert t.render(test=test) == "AB" |
| 263 | t = Template("A{{ test().missingattribute }}B") |
| 264 | pytest.raises(UndefinedError, t.render, test=test) |
| 265 | |
| 266 | def test_undefined_and_special_attributes(self): |
| 267 | with pytest.raises(AttributeError): |