'Test ordering by a field not present on all items.'

def test_field_present_in_some_items(self):

    items = self.lib.items(u'id+')
    ids = [i.id for i in items]
    items[1].foo = u'bar1'
    items[2].foo = u'bar2'
    items[1].store()
    items[2].store()
    results_asc = list(self.lib.items(u'foo+    id+'))
    self.assertEqual([i.id for i in results_asc], [ids[0], ids[3], ids[1], ids[2]])
    results_desc = list(self.lib.items(u'foo-    id+'))
    self.assertEqual([i.id for i in results_desc], [ids[2], ids[1], ids[0], ids[3]])
