Skip to content

"if not" condition not working properly  #209

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions