Condition evaluates to true always

Why does the following code ALWAYS print ‘TEST’?

{% if {{page.url | slugify}} == 'abcd' and page.main_nav != false %}
    TEST
{% endif %}

Solved by using a variable instead:
{% assign myvariable = {{page.url | slugify}} %}

Then:
{% if myvariable == 'abcd' and page.main_nav != false %}