diff --git a/awx/main/tests/unit/utils/test_filters.py b/awx/main/tests/unit/utils/test_filters.py index 910217deab..dfa9970bac 100644 --- a/awx/main/tests/unit/utils/test_filters.py +++ b/awx/main/tests/unit/utils/test_filters.py @@ -62,8 +62,8 @@ class TestSmartFilterQueryFromString(): ('(a=b and c=d)', Q(**{u"a": u"b"}) & Q(**{u"c": u"d"})), ('a=b or c=d', Q(**{u"a": u"b"}) | Q(**{u"c": u"d"})), ('(a=b and c=d) or (e=f)', (Q(**{u"a": u"b"}) & Q(**{u"c": u"d"})) | (Q(**{u"e": u"f"}))), - ('(a=b and not c=d) or not (e=f)', (Q(**{u"a": u"b"}) & ~Q(**{u"c": u"d"})) | (~Q(**{u"e": u"f"}))), - ('(a=b) and not (c=d or (e=f and (g=h or i=j))) or (y=z)', Q(**{u"a": u"b"}) & ~(Q(**{u"c": u"d"}) | (Q(**{u"e": u"f"}) & (Q(**{u"g": u"h"}) | Q(**{u"i": u"j"})))) | Q(**{u"y": u"z"})), + #('(a=b and not c=d) or not (e=f)', (Q(**{u"a": u"b"}) & ~Q(**{u"c": u"d"})) | (~Q(**{u"e": u"f"}))), + #('(a=b) and not (c=d or (e=f and (g=h or i=j))) or (y=z)', Q(**{u"a": u"b"}) & ~(Q(**{u"c": u"d"}) | (Q(**{u"e": u"f"}) & (Q(**{u"g": u"h"}) | Q(**{u"i": u"j"})))) | Q(**{u"y": u"z"})), ('a=b or a=d or a=e or a=z and b=h and b=i and b=j and b=k', Q(**{u"a": u"b"}) | Q(**{u"a": u"d"}) | Q(**{u"a": u"e"}) | Q(**{u"a": u"z"}) & Q(**{u"b": u"h"}) & Q(**{u"b": u"i"}) & Q(**{u"b": u"j"}) & Q(**{u"b": u"k"})) ]) def test_boolean_parenthesis(self, mock_get_host_model, filter_string, q_expected): diff --git a/awx/main/utils/filters.py b/awx/main/utils/filters.py index 845d75a852..5bc71327c6 100644 --- a/awx/main/utils/filters.py +++ b/awx/main/utils/filters.py @@ -199,7 +199,7 @@ class SmartFilter(object): grammar.setParseAction(cls.BoolOperand) boolExpr = infixNotation(grammar, [ - ("not", 1, opAssoc.RIGHT, cls.BoolNot), + #("not", 1, opAssoc.RIGHT, cls.BoolNot), ("and", 2, opAssoc.LEFT, cls.BoolAnd), ("or", 2, opAssoc.LEFT, cls.BoolOr), ])