'Test that a discussion item, even if it doesn\'t set its discussion_id,
consistently generates the same one'

@ddt.data(ModuleStoreEnum.Type.split, ModuleStoreEnum.Type.mongo)
def test_forum_id_generation(self, default_store):

    course = CourseFactory.create(default_store=default_store)
    discussion_item = self.store.create_item(self.user.id, course.id, 'discussion', 'new_component')
    fetched = self.store.get_item(discussion_item.location)
    refetched = self.store.get_item(discussion_item.location)
    self.assertEqual(fetched.discussion_id, discussion_item.discussion_id)
    self.assertEqual(fetched.discussion_id, refetched.discussion_id)
    self.assertNotEqual(discussion_item.discussion_id, '$$GUID$$')
