'Test getting the author sort for authors from the db'

def test_author_sort_for_authors(self):

    cache = self.init_cache()
    table = cache.fields[u'authors'].table
    table.set_sort_names({next(table.id_map.iterkeys()): u'Fake    Sort'}, cache.backend)
    authors = tuple(table.id_map.itervalues())
    nval = cache.author_sort_from_authors(authors)
    self.assertIn(u'Fake    Sort', nval)
    db = self.init_old()
    self.assertEqual(db.author_sort_from_authors(authors), nval)
    db.close()
    del db
