Merge pull request #23634 from edx/BOM-1495
BOM-1495: Django 2.0: fails on comparing nested lists.
This commit is contained in:
@@ -360,11 +360,9 @@ class CategoryMapTestMixin(object):
|
||||
Call `get_discussion_category_map`, and verify that it returns
|
||||
what is expected.
|
||||
"""
|
||||
|
||||
self.assertEqual(
|
||||
utils.get_discussion_category_map(self.course, requesting_user or self.user),
|
||||
expected
|
||||
)
|
||||
actual = utils.get_discussion_category_map(self.course, requesting_user or self.user)
|
||||
actual['subcategories']['Week 1']['children'].sort()
|
||||
self.assertEqual(actual, expected)
|
||||
|
||||
|
||||
class CategoryMapTestCase(CategoryMapTestMixin, ModuleStoreTestCase):
|
||||
@@ -1151,43 +1149,35 @@ class ContentGroupCategoryMapTestCase(CategoryMapTestMixin, ContentGroupTestCase
|
||||
Verify that the beta user can access the beta and global
|
||||
discussion topics.
|
||||
"""
|
||||
|
||||
children = [('Visible to Beta', 'entry'), ('Visible to Everyone', 'entry')]
|
||||
|
||||
if six.PY3:
|
||||
children = [('Visible to Everyone', 'entry'), ('Visible to Beta', 'entry')]
|
||||
|
||||
expected = {
|
||||
'subcategories': {
|
||||
'Week 1': {
|
||||
'subcategories': {},
|
||||
'children': children,
|
||||
'entries': {
|
||||
'Visible to Beta': {
|
||||
'sort_key': None,
|
||||
'is_divided': False,
|
||||
'id': 'beta_group_discussion'
|
||||
},
|
||||
'Visible to Everyone': {
|
||||
'sort_key': None,
|
||||
'is_divided': False,
|
||||
'id': 'global_group_discussion'
|
||||
self.assert_category_map_equals(
|
||||
{
|
||||
'subcategories': {
|
||||
'Week 1': {
|
||||
'subcategories': {},
|
||||
'children': [('Visible to Beta', 'entry'), ('Visible to Everyone', 'entry')],
|
||||
'entries': {
|
||||
'Visible to Beta': {
|
||||
'sort_key': None,
|
||||
'is_divided': False,
|
||||
'id': 'beta_group_discussion'
|
||||
},
|
||||
'Visible to Everyone': {
|
||||
'sort_key': None,
|
||||
'is_divided': False,
|
||||
'id': 'global_group_discussion'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
'children': [('General', 'entry'), ('Week 1', 'subcategory')],
|
||||
'entries': {
|
||||
'General': {
|
||||
'sort_key': 'General',
|
||||
'is_divided': False,
|
||||
'id': 'i4x-org-number-course-run'
|
||||
}
|
||||
}
|
||||
},
|
||||
'children': [('General', 'entry'), ('Week 1', 'subcategory')],
|
||||
'entries': {
|
||||
'General': {
|
||||
'sort_key': 'General',
|
||||
'is_divided': False,
|
||||
'id': 'i4x-org-number-course-run'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.assert_category_map_equals(
|
||||
expected,
|
||||
requesting_user=self.beta_user
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user