Commits

Luke Plant  committed 2297290

Incresed max_coluumns to 6

  • Participants
  • Parent commits 8459585

Comments (0)

Files changed (2)

File semanticeditor/tests.py

 
 from django.test import TestCase
 from semanticeditor.utils import extract_structure, InvalidHtml, IncorrectHeadings, format_html, parse, get_parent, get_index, BadStructure, TooManyColumns, NEWROW, NEWCOL, extract_presentation, get_structure
-from semanticeditor.utils.presentation import PresentationInfo, PresentationClass, StructureItem
+from semanticeditor.utils.presentation import PresentationInfo, PresentationClass, StructureItem, LayoutDetails
 
 PC = PresentationClass
 
         self.assertEqual(set([p1]), set([p2]))
 
 class TestFormat(TestCase):
+    def setUp(self):
+        # monkey patch to ensure some assumptions we make about LayoutDetails.
+        # We may have to go the whole hog and do dependency injection at some
+        # point.
+        self._old_max_columns = LayoutDetails.max_columns
+        LayoutDetails.max_columns = 4
+        super(TestCase, self).setUp()
+
+    def tearDown(self):
+        LayoutDetails.max_columns = self._old_max_columns
+        super(TestCase, self).tearDown()
+
     def test_empty(self):
         self.assertEqual('<div class="row" />', format_html('', {}));
 

File semanticeditor/utils/presentation.py

     COLUMN_CLASS = "column"
 
     # Public interface:
-    max_columns = 4 # max number of columns to allow
+    max_columns = 6 # max number of columns to allow
     use_inner_column_div = True # True to wrap all column content in a inner div
     def row_classes(self, logical_column_count, actual_column_count):
         """