コード例 #1
0
ファイル: test_api.py プロジェクト: CraftAcademy/edx-platform
    def test_get_parent_with_category(self):
        """ Test test_get_parent_of_category """

        result = _get_xblock_parent(self.vert1, 'sequential')
        self.assertEqual(result.location, self.seq1.location)
        result = _get_xblock_parent(self.vert1, 'chapter')
        self.assertEqual(result.location, self.chapter1.location)
コード例 #2
0
    def test_get_parent_with_category(self):
        """ Test test_get_parent_of_category """

        result = _get_xblock_parent(self.vert1, 'sequential')
        self.assertEqual(result.location, self.seq1.location)
        result = _get_xblock_parent(self.vert1, 'chapter')
        self.assertEqual(result.location, self.chapter1.location)
コード例 #3
0
ファイル: test_api.py プロジェクト: CraftAcademy/edx-platform
    def test_get_direct_parent(self):
        """ Test test_get_direct_parent """

        result = _get_xblock_parent(self.vert1)
        self.assertEqual(result.location, self.seq1.location)
コード例 #4
0
ファイル: test_api.py プロジェクト: CraftAcademy/edx-platform
    def test_get_parent_none(self):
        """ Test test_get_parent_none """

        result = _get_xblock_parent(self.vert1, 'unit')
        self.assertIsNone(result)
コード例 #5
0
    def test_get_parent_none(self):
        """ Test test_get_parent_none """

        result = _get_xblock_parent(self.vert1, 'unit')
        self.assertIsNone(result)
コード例 #6
0
    def test_get_direct_parent(self):
        """ Test test_get_direct_parent """

        result = _get_xblock_parent(self.vert1)
        self.assertEqual(result.location, self.seq1.location)