<s> import django . template <EOL> import pretend <EOL> def test_compile_filter ( monkeypatch ) : <EOL> compile_static = pretend . call_recorder ( lambda source_path : "<STR_LIT>" ) <EOL> monkeypatch . setattr ( "<STR_LIT>" , compile_static ) <EOL> template = django . template . Template ( """<STR_LIT>""" ) <EOL> assert template . render ( django . template . Context ( { } ) ) == "<STR_LIT>" <EOL> monkeypatch . setattr ( "<STR_LIT>" , True ) <EOL> assert template . render ( django . template . Context ( { } ) ) == "<STR_LIT>" <EOL> assert compile_static . calls == [ pretend . call ( "<STR_LIT:source>" ) , pretend . call ( "<STR_LIT:source>" ) ] <EOL> def test_inlinecompile_tag ( monkeypatch ) : <EOL> compiler = pretend . stub ( compile_source = pretend . call_recorder ( lambda * args : "<STR_LIT>" ) ) <EOL> get_compiler_by_name = pretend . call_recorder ( lambda * args : compiler ) <EOL> monkeypatch . setattr ( "<STR_LIT>" , get_compiler_by_name ) <EOL> template = django . template . Template ( <EOL> "<STR_LIT>" <EOL> ) <EOL> assert template . render ( django . template . Context ( { } ) ) == "<STR_LIT>" <EOL> assert get_compiler_by_name . calls == [ pretend . call ( "<STR_LIT>" ) ] <EOL> assert compiler . compile_source . calls == [ pretend . call ( "<STR_LIT:source>" ) ] </s>
