'Given a Query `q`, assert that:
- q OR not(q) == all items
- q AND not(q) == 0
- not(not(q)) == q'

def assertNegationProperties(self, q):

    not_q = dbcore.query.NotQuery(q)
    q_or = dbcore.query.OrQuery([q, not_q])
    q_and = dbcore.query.AndQuery([q, not_q])
    self.assert_items_matched_all(self.lib.items(q_or))
    self.assert_items_matched(self.lib.items(q_and), [])
    all_titles = set([i.title for i in self.lib.items()])
    q_results = set([i.title for i in self.lib.items(q)])
    not_q_results = set([i.title for i in self.lib.items(not_q)])
    self.assertEqual(q_results.union(not_q_results), all_titles)
    self.assertEqual(q_results.intersection(not_q_results), set())
    not_not_q = dbcore.query.NotQuery(not_q)
    self.assertEqual(set([i.title for i in self.lib.items(q)]), set([i.title for i in self.lib.items(not_not_q)]))
