Commits

Mads Sülau Valstorp Jørgensen committed c3f9b84

Fixed whitespace replacing tabs, added regression test

Comments (0)

Files changed (2)

chart_tools/templatetags/chart_tags.py

 
 def prepare_chart(input, attr=''):
     # remove whitespaces
-    input_lines = input.replace(' ', '').splitlines()
+    input_lines = input.replace(' ', '').replace('\t', '').splitlines()
 
     # build url
     lines = []

chart_tools/tests.py

 
     def test_cleaned_chart(self):
         self.assertChartRendered('cleaned_up')
+
+class RegressionTest(TestCase):
+
+    def test_tab_as_whitespace(self):
+        chart_input = FIXTURES['cleaned_up'].replace(" ", "\t")
+        self.assertFalse(chart_input.find("\t") == -1)
+        chart_img = prepare_chart(chart_input)
+        self.assertTrue(chart_img.find("\t") == -1)
+