Browse Source

Add leading & trailing spaces to all operators in LefilteredQuery

Doing so forbids operators like << == =! in* etc..
The tests were updated
Yann Weber 9 years ago
parent
commit
5991bc8e6f
2 changed files with 9 additions and 6 deletions
  1. 6
    6
      lodel/leapi/query.py
  2. 3
    0
      tests/leapi/query/test_filtered.py

+ 6
- 6
lodel/leapi/query.py View File

@@ -92,12 +92,12 @@ class LeFilteredQuery(LeQuery):
92 92
     
93 93
     ##@brief The available operators used in query definitions
94 94
     _query_operators = [
95
-                        '=',
96
-                        '<=',
97
-                        '>=',
98
-                        '!=',
99
-                        '<',
100
-                        '>',
95
+                        ' = ',
96
+                        ' <= ',
97
+                        ' >= ',
98
+                        ' != ',
99
+                        ' < ',
100
+                        ' > ',
101 101
                         ' in ',
102 102
                         ' not in ',
103 103
                         ' like ',

tests/leapi/query/test_filtere.py → tests/leapi/query/test_filtered.py View File

@@ -73,6 +73,9 @@ class LeFilteredQueryTestCase(unittest.TestCase):
73 73
                             "'",
74 74
                             "not_exists != bar",
75 75
                             "lodel_id # bar",
76
+                            "lodel_id == bar",
77
+                            "lodel_id =! bar",
78
+                            "lodel_id >> bar",
76 79
                             "lodel_id ind 42,43",
77 80
                             "lodel_id llike 42",
78 81
                             ('lodel_id', '', '42'),

Loading…
Cancel
Save