add ne and ne test.

This commit is contained in:
Hellowlol 2017-10-14 01:46:09 +02:00
parent bdee9ad1f1
commit b5a3018c6b
2 changed files with 5 additions and 0 deletions

View file

@ -11,6 +11,7 @@ OPERATORS = {
'iexact': lambda v, q: v.lower() == q.lower(),
'contains': lambda v, q: q in v,
'icontains': lambda v, q: q.lower() in v.lower(),
'ne': lambda v, q: v != q,
'in': lambda v, q: v in q,
'gt': lambda v, q: v > q,
'gte': lambda v, q: v >= q,

View file

@ -10,6 +10,10 @@ def test_video_Movie(movies, movie):
assert movie2.title == movie.title
def test_video_ne(movies):
assert len(movies.fetchItems('/library/sections/7/all', title__ne='Sintel')) == 3
def test_video_Movie_delete(monkeypatch, movie):
monkeypatch.delattr('requests.sessions.Session.request')
with pytest.raises(AttributeError):