diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-01-30 10:20:41 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-01-30 10:20:41 +0100 |
commit | 16e6456f197abbba596ff469fc3b5a300a147848 (patch) | |
tree | a75fe8104abf7dacc5f26a4d19a8a164508260d7 | |
parent | 0a4e62e696bfec66e12442395dc9c92d42f4aaa7 (diff) | |
download | Ishtar-16e6456f197abbba596ff469fc3b5a300a147848.tar.bz2 Ishtar-16e6456f197abbba596ff469fc3b5a300a147848.zip |
Tests: fix warehouse division creation test
-rw-r--r-- | archaeological_warehouse/tests.py | 6 | ||||
-rw-r--r-- | ishtar_common/utils.py | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/archaeological_warehouse/tests.py b/archaeological_warehouse/tests.py index cf3c1febc..f05a0e9dd 100644 --- a/archaeological_warehouse/tests.py +++ b/archaeological_warehouse/tests.py @@ -60,12 +60,8 @@ class WarehouseWizardCreationTest(WizardTest, FindInit, TestCase): 'location': None, 'responsible': None, }, - 'divisions-warehouse_creation': [ - { - 'order': 42 - } - ] }, + ignored=['divisions-warehouse_creation'] ), ] diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py index 3e05ff6eb..1d44026e0 100644 --- a/ishtar_common/utils.py +++ b/ishtar_common/utils.py @@ -1032,9 +1032,11 @@ def rename_and_simplify_media_name(full_path_name, rename=True): :return: new full path name (or old if not changed), modified """ try: + is_str = False exists = os.path.exists(full_path_name) is_file = os.path.isfile(full_path_name) except UnicodeEncodeError: + is_str = True full_path_name = full_path_name.encode('utf-8') exists = os.path.exists(full_path_name) is_file = os.path.isfile(full_path_name) @@ -1043,6 +1045,10 @@ def rename_and_simplify_media_name(full_path_name, rename=True): path, current_name, name = simplify_name(full_path_name, check_existing=True) + if is_str: + full_path_name = full_path_name.decode('utf-8') + name = name.decode('utf-8') + path = path.decode('utf-8') if current_name == name: return full_path_name, False |