mirror of
https://github.com/ansible/awx.git
synced 2026-03-28 14:25:05 -02:30
fix up test
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
|
|
||||||
# Python
|
# Python
|
||||||
import pytest
|
import pytest
|
||||||
from pyparsing import ParseException
|
|
||||||
|
|
||||||
# AWX
|
# AWX
|
||||||
from awx.main.fields import DynamicFilterField
|
from awx.main.fields import DynamicFilterField
|
||||||
@@ -32,8 +31,9 @@ class TestDynamicFilterFieldFilterStringToQ():
|
|||||||
'a__b__c__ space =ggg',
|
'a__b__c__ space =ggg',
|
||||||
])
|
])
|
||||||
def test_invalid_filter_strings(self, filter_string):
|
def test_invalid_filter_strings(self, filter_string):
|
||||||
with pytest.raises(ParseException):
|
with pytest.raises(RuntimeError) as e:
|
||||||
DynamicFilterField.filter_string_to_q(filter_string)
|
DynamicFilterField.filter_string_to_q(filter_string)
|
||||||
|
assert e.value.message == u"Invalid query " + filter_string
|
||||||
|
|
||||||
@pytest.mark.parametrize("filter_string,q_expected", [
|
@pytest.mark.parametrize("filter_string,q_expected", [
|
||||||
(u'(a=abc\u1F5E3def)', Q(**{u"a": u"abc\u1F5E3def"})),
|
(u'(a=abc\u1F5E3def)', Q(**{u"a": u"abc\u1F5E3def"})),
|
||||||
|
|||||||
Reference in New Issue
Block a user