tests ‘added’ instead of ‘mtime’ , and uses a correct date format

This commit is contained in:
discopatrick 2017-04-14 13:04:45 +01:00
parent ed0ea1dee5
commit ff4c0abcf1

View file

@ -890,11 +890,11 @@ class NotQueryTest(DummyDataTestCase):
self.assert_items_matched(not_results, [u'beets 4 eva'])
self.assertNegationProperties(q)
@unittest.skip # skip until I can figure out what this test is doing
def test_type_date(self):
q = dbcore.query.DateQuery(u'mtime', u'0.0')
q = dbcore.query.DateQuery(u'added', u'2000-01-01')
not_results = self.lib.items(dbcore.query.NotQuery(q))
self.assert_items_matched(not_results, [])
# query date is in the past, thus the 'not' results should contain all items
self.assert_items_matched(not_results, [u'foo bar', u'baz qux', u'beets 4 eva'])
self.assertNegationProperties(q)
def test_type_false(self):
@ -993,8 +993,7 @@ class NotQueryTest(DummyDataTestCase):
AttributeError: type object 'NoneQuery' has no attribute 'field'
at NoneQuery.match() (due to being @classmethod, and no self?)
"""
classes = [#(dbcore.query.DateQuery, [u'mtime', u'0.0']), # skip until I can figure out what this test is doing
# replacing '0.0' with a proper date e.g. '2001-01-01' passes the test
classes = [(dbcore.query.DateQuery, [u'added', u'2001-01-01']),
(dbcore.query.MatchQuery, [u'artist', u'one']),
# (dbcore.query.NoneQuery, ['rg_track_gain']),
(dbcore.query.NumericQuery, [u'year', u'2002']),