Skip to content

"if not" condition not working properly  #209

@dgofman

Description

@dgofman

Open file: pongo2/template_tests/if.tpl and add two conditions after this line:
{% if "Text" in complex.post %}text field in complex.post{% endif %}

Hello string {% if not "Hello" in complex.post.Text %}is not{% else %}is{% endif %} in complex.post.Text
World string {% if not "World" in complex.post.Text %}is not{% else %}is{% endif %} in complex.post.Text

In pongo2_template_test.go the "complex.post.Text" = <h2>Hello!</h2><p>Welcome...

So, we are expecting the "World" does not exist in the string we should get two different results, However result are:

 Hello string is in complex.post.Text
 World string is in complex.post.Text

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions