aboutsummaryrefslogtreecommitdiff
path: root/tests/docx
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2013-12-03 18:04:34 +0000
committerMichael Williamson <mike@zwobble.org>2013-12-03 18:04:34 +0000
commit5e1685645c6b0ed81bc27f3cedfeb0608f79f495 (patch)
treeba1125db8fa05f1cc8a0ffa6f628ca70e250aa07 /tests/docx
parent2cbb7baa6615835b7d4cb81dd2300569c0bafd4a (diff)
Read overrides from content types
Diffstat (limited to 'tests/docx')
-rw-r--r--tests/docx/content_types_xml_tests.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/docx/content_types_xml_tests.py b/tests/docx/content_types_xml_tests.py
index 56b5a86..1c26b34 100644
--- a/tests/docx/content_types_xml_tests.py
+++ b/tests/docx/content_types_xml_tests.py
@@ -17,3 +17,22 @@ def content_type_is_based_on_default_for_extension_if_there_is_no_override():
"image/png",
content_types.find_content_type("word/media/hat.png"),
)
+
+
+@istest
+def content_type_is_based_on_default_for_extension_if_there_is_no_override():
+ element = xml_element("content-types:Types", {}, [
+ xml_element("content-types:Default", {
+ "Extension": "png",
+ "ContentType": "image/png",
+ }),
+ xml_element("content-types:Override", {
+ "PartName": "/word/media/hat.png",
+ "ContentType": "image/hat"
+ }),
+ ])
+ content_types = read_content_types_xml_element(element)
+ assert_equal(
+ "image/hat",
+ content_types.find_content_type("word/media/hat.png"),
+ )