Example #1
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)
Example #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)
Example #3
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)
Example #4
0
    def test_get_parent_none(self):
        """ Test test_get_parent_none """

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

        result = _get_xblock_parent(self.vert1, 'unit')
        self.assertIsNone(result)
Example #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)