switch to using get() rather than get_or_create(). Also add a test case with a different casing on the courseId
This commit is contained in:
@@ -1297,8 +1297,19 @@ class ContentStoreTest(ModuleStoreTestCase):
|
||||
def test_forum_unseeding(self):
|
||||
"""Test new course creation and verify forum seeding """
|
||||
test_course_data = self.assert_created_course(number_suffix=uuid4().hex)
|
||||
unseed_permissions_roles(self._get_course_id(test_course_data))
|
||||
self.assertFalse(are_permissions_roles_seeded(self._get_course_id(test_course_data)))
|
||||
course_id = self._get_course_id(test_course_data)
|
||||
unseed_permissions_roles(course_id)
|
||||
self.assertFalse(are_permissions_roles_seeded(course_id))
|
||||
|
||||
def test_forum_unseeding_with_different_casing(self):
|
||||
"""Test new course creation and verify forum seeding """
|
||||
test_course_data = self.assert_created_course(number_suffix=uuid4().hex)
|
||||
# make sure we don't delete a forum permissions set with different casing
|
||||
# than the passed in course_id. This is because Mongo and MySQL are using different collations
|
||||
course_id = self._get_course_id(test_course_data)
|
||||
unseed_permissions_roles(course_id.upper())
|
||||
# permissions should still be there!
|
||||
self.assertTrue(are_permissions_roles_seeded(course_id))
|
||||
|
||||
def _get_course_id(self, test_course_data):
|
||||
"""Returns the course ID (org/number/run)."""
|
||||
|
||||
Reference in New Issue
Block a user