1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 from uitest
.framework
import UITestCase
10 from uitest
.uihelper
.common
import get_url_for_data_file
11 from libreoffice
.uno
.propertyvalue
import mkPropertyValues
13 #Bug 89383 - Read-only passwords on OOXML files are not working
15 class tdf89383(UITestCase
):
16 def test_tdf89383_DOCX(self
):
17 with self
.ui_test
.load_file(get_url_for_data_file("writeprotection.docx")):
18 document
= self
.ui_test
.get_component()
20 # Without the fix in place, this test would have failed with
21 # AssertionError: False is not true
22 self
.assertTrue(document
.isReadonly())
24 with self
.ui_test
.execute_dialog_through_command(".uno:EditDoc") as xDialog
:
25 xPassword
= xDialog
.getChild("newpassEntry")
26 xPassword
.executeAction("TYPE", mkPropertyValues({"TEXT": "a"}))
28 self
.assertFalse(document
.isReadonly())
30 # vim: set shiftwidth=4 softtabstop=4 expandtab: