Skip to content
Snippets Groups Projects
Commit ecda6ebe authored by Thomas Holene Løkkeborg's avatar Thomas Holene Løkkeborg
Browse files

#70 test for plassering av vedleggsmoduler

parent f2d79a6e
No related branches found
No related tags found
1 merge request!65#70 Støtte for vedlegg i InlineEditableSOIView & i soi.py
Pipeline #80842 passed
......@@ -16,7 +16,7 @@ from soitool.soi import ModuleLargerThanBinError
from soitool.dialog_wrappers import exec_warning_dialog
from soitool.serialize_export_import_soi import generate_soi_filename
# how attachment pages should be numbered. The first page should be numbered
# How attachment pages should be numbered. The first page should be numbered
# by the value of ATTACHMENT_NUMBERING_SCHEME[0], the second page
# ATTACHMENT_NUMBERING_SCHEME[1], and so on.
ATTACHMENT_NUMBERING_SCHEME = list(string.ascii_uppercase)
......
......@@ -414,6 +414,31 @@ class TestSOI(unittest.TestCase):
lambda: self.soi.update_properties(invalid_key="garbage"),
)
def test_reorganize_attachments(self):
"""Test that calling reorganize properly reorganized attachments.
Attachments should appear on their own pages, starting after the last
non-attachment page. The attachments should be placed at the top-left
corner.
"""
self.soi.reorganize()
# Modules of SOI from self.setUp will all be placed on first page, so
# expect the three attachment modules also from self.setUp on pages
# 2,3,4
self.assertEqual(
self.soi.attachments[0]["meta"],
{"x": 0, "y": 0, "page": 2, "name": "tall_module"},
)
self.assertEqual(
self.soi.attachments[1]["meta"],
{"x": 0, "y": 0, "page": 3, "name": "wide_module"},
)
self.assertEqual(
self.soi.attachments[2]["meta"],
{"x": 0, "y": 0, "page": 4, "name": "big_module"},
)
def deep_copy_of_modules_list(modules, widget_cloner):
"""Get deep copy of modules list. Works for both modules and attachments.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment