def test_strip_version_and_branch(self):
        """
        Tests that the _strip_version_and_branch function strips the version
        and branch from a location
        """
        location = self.course.id.make_usage_key(
            'test_block_type', 'test_block_id').for_branch(
                'test_branch').for_version('test_version')

        self.assertIsNotNone(location.branch)
        self.assertIsNotNone(location.version_guid)

        stripped_location = strip_branch_and_version(location)

        self.assertIsNone(stripped_location.branch)
        self.assertIsNone(stripped_location.version_guid)
    def test_strip_version_and_branch(self):
        """
        Tests that the _strip_version_and_branch function strips the version
        and branch from a location
        """
        location = self.course.id.make_usage_key(
            'test_block_type', 'test_block_id'
        ).for_branch(
            'test_branch'
        ).for_version('test_version')

        self.assertIsNotNone(location.branch)
        self.assertIsNotNone(location.version_guid)

        stripped_location = strip_branch_and_version(location)

        self.assertIsNone(stripped_location.branch)
        self.assertIsNone(stripped_location.version_guid)