This commit is contained in:
Kovid Goyal 2013-02-19 16:34:32 +05:30
parent 252f951082
commit 3eb5006a31

View File

@ -257,18 +257,18 @@ class ReadingTest(BaseTest):
'id_set', 'avg_rating', 'sort', 'use_sort_as_name', 'id_set', 'avg_rating', 'sort', 'use_sort_as_name',
'tooltip', 'icon', 'category'): 'tooltip', 'icon', 'category'):
oval, nval = getattr(old, attr), getattr(new, attr) oval, nval = getattr(old, attr), getattr(new, attr)
if oval != nval: if (
if ( (category in {'rating', '#rating'} and attr in {'id_set', 'sort'}) or
(category in {'rating', '#rating'} and attr in {'id_set', 'sort'}) or (category == 'series' and attr == 'sort') or # Sorting is wrong in old
(category == 'series' and attr == 'sort') or # Sorting is wrong in old (category == 'identifiers' and attr == 'id_set') or
(category == 'identifiers' and attr == 'id_set') or (category == '@Good Series') or # Sorting is wrong in old
(category == '@Good Series') or # Sorting is wrong in old (category == 'news' and attr in {'count', 'id_set'})
(category == 'news' and attr in {'count', 'id_set'}) ):
): continue
continue self.assertEqual(oval, nval,
self.assertTrue(False, 'The attribute %s for %s in category %s does not match. Old is %r, New is %r'
'The attribute %s for %s in category %s does not match. Old is %r, New is %r' %(attr, old.name, category, oval, nval))
%(attr, old.name, category, oval, nval))
for category in old_categories: for category in old_categories:
old, new = old_categories[category], new_categories[category] old, new = old_categories[category], new_categories[category]
self.assertEqual(len(old), len(new), self.assertEqual(len(old), len(new),